How can i use the `eject` command on a computer i have SSH'd into?

0

So if i do eject on my machine, it works exactly as expected, however, if i ssh into the machine next to me, and do the same thing, it does not work...

my computer:

eject: using default device `cdrom'
eject: device name is `cdrom'
eject: expanded name is `/dev/cdrom'
eject: `/dev/cdrom' is a link to `/dev/sr0'
eject: `/dev/sr0' is not mounted
eject: `/dev/sr0' is not a mount point
eject: checking if device "/dev/sr0" has a removable or hotpluggable flag
eject: `/dev/sr0' is not a multipartition device
eject: trying to eject `/dev/sr0' using CD-ROM eject command
eject: CD-ROM eject command succeeded

other computer:

eject: using default device `cdrom'
eject: device name is `cdrom'
eject: expanded name is `/dev/cdrom'
eject: `/dev/cdrom' is a link to `/dev/sr0'
eject: `/dev/sr0' is not mounted
eject: `/dev/sr0' is not a mount point
eject: checking if device "/dev/sr0" has a removable or hotpluggable flag
eject: `/dev/sr0' is not a multipartition device
eject: unable to open `/dev/sr0'

if i look in the /dev/ dir, then i find cdrom which is a symlink to sr0 - as mentioned by the verbose outputs of eject -v. On my machine, if i try and look at it, if the drive is open, it will close it, and then give this:

$ less sr0
sr0 is not a regular file (use -f to see it)

so

$ less -f sr0
sr0: No medium found

but if i do it on the other computer,

$ less -f sr0
sr0: Permission denied

so i look at the files more, and get this on both machines:

$ ls -la sr0
brw-rw----+ 1 root cdrom 11, 0 Nov 12 10:13 sr0

Does anyone know a way around this? I do not have root access.

If i log into a computer graphically, and then ssh from another machine, i can eject drive remotely, but only if i'm already logged in to the computer.

will

Posted 2012-11-23T15:53:20.237

Reputation: 131

I think it is bad for you to mess around like that ;) and btw wrong se : ) – None – 2012-11-23T15:55:32.240

Answers

1

Try running groups | grep -o cdrom on the other computer.
If "cdrom" is not printed then you probably have to get put in that group to have access to the cd drive. You will have to ask someone with permissions to add you.

ShadowNinja

Posted 2012-11-23T15:53:20.237

Reputation: 11

It's not printed, but i still have access to eject the drive on the machine i'm graphically logged into... – will – 2012-11-26T13:04:29.293

Does it print in graphical login using a terminal emulator? – ShadowNinja – 2012-11-27T16:29:53.307

nope, the only groups i'm members of are the various user groups. – will – 2012-11-27T19:38:01.810

0

If you are logged in graphically, your desktop manager may have fooled around with /dev/sr0's ACL, as indicated by the + sign.

So you have more rights than on the other PC.

glglgl

Posted 2012-11-23T15:53:20.237

Reputation: 1 327

Is there anyway to repeat this Tom foolery without being root? – will – 2012-11-26T09:50:39.397