Find the answer to your Linux question:
Results 1 to 3 of 3
Is there anyway to use the eject command as a user? I wrote a very short script to eject my ipod safely but i'm unable to run it from my ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru Juan Pablo's Avatar
    Join Date
    Mar 2006
    Location
    /home/south_america/ecuador/quito
    Posts
    2,064

    eject command as user?


    Is there anyway to use the eject command as a user?
    I wrote a very short script to eject my ipod safely but i'm unable to run it from my desktop because eject can only be used by root

    My iPod is /dev/sda but it mounted automatically by gnome as /dev/sda2

    Thanks in advance
    Put your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
    Linux User #425940

    Don't PM me with questions, instead post in the forums

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,844
    There are a couple of solutions to this, you could try either:

    Use the sudo command to give you permissions to run root commands using your regular log in password or...

    You could find the command 'eject' ('locate eject' should work nicely) and change it's group (chgrp ...) to something like 'wheel'. Then all you need to do is edit your /etc/group file and add yourself to that group, and log off then back on again. Provided the group has execute permissions on the binary (use chmod g+x ...) then it should just work.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Linux Guru Juan Pablo's Avatar
    Join Date
    Mar 2006
    Location
    /home/south_america/ecuador/quito
    Posts
    2,064
    Well, I think I can't use sudo in a script because it requieres user input but the second solution will work

    Thanks!
    Put your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
    Linux User #425940

    Don't PM me with questions, instead post in the forums

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •