Howto: Eject cd with ssh

h‮w//:sptt‬ww.lautturi.com
Howto: Eject cd with ssh

To eject a CD from a remote system over SSH, you can use the eject command.

For example, to eject the CD from the CD-ROM drive on a remote system, you can use the following command:

ssh user@remotehost "eject /dev/cdrom"

This will eject the CD from the CD-ROM drive on the remote system.

Keep in mind that you'll need to have the necessary permissions to run the eject command on the remote system. You may need to use sudo if you don't have sufficient privileges.

ssh user@remotehost "sudo eject /dev/cdrom"

You can also use the -T option to disable pseudo-tty allocation, which can be useful if you're running the command from a script:

ssh -T user@remotehost "eject /dev/cdrom"

Note that the exact device name for the CD-ROM drive may vary depending on the system. Some common device names include /dev/cdrom, /dev/cdrw, and /dev/dvd. You may need to try different device names if the above command doesn't work.

Created Time:2017-10-29 22:08:47  Author:lautturi