Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > sudo command

sudo command
Thread Tools
Fresh-Faced Recruit
Join Date: Aug 2006
Status: Offline
Reply With Quote
Aug 16, 2006, 04:54 AM
 
Hi,

Sudo command allows a permitted user to execute command as another user as specified in the sudoers file. "Sudo su" lets one continuously have the superuser privelege, ie; the privelege doesn't die after one command. "Sudo su -" prevents detail of each command from being logged.

Now what does "sudo su - <username>" do. Example::"sudo su - dwhprod"

Any help is much appreciated.

Thanks.
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Aug 17, 2006, 12:37 PM
 
You switch to user dwhprod by supplying the root password.

You're really stringing together commands, you know. You can get to a root shell (yes, that's what you do by hitting "sudo su") by just typing "sudo -s" or (if root is enabled, which it isn't by default on OS X) just "su". You can switch to any user by typing "su username". That will request the login password for that user, however, not the root password. What you're doing is that you first authenticate as root, with sudo, and then use root to run "su username". Running su as root does not require a password, so you only get one password request (for sudo). The - just stops reading switches.
     
Dedicated MacNNer
Join Date: Mar 2005
Location: Netherlands
Status: Offline
Reply With Quote
Apr 24, 2007, 11:07 AM
 
How do you get myself on the sudoers list? I installed ntfs-3g and I need to unmount and mount the drive with the sudo command.
Apple Powerbook 17" 1,67 GHz, 2 gig RAM, 100 gig HDD, ATI Mobility Radeon 9700 128MB, Superdrive 8X
     
Mac Elite
Join Date: Nov 2001
Status: Offline
Reply With Quote
Apr 24, 2007, 03:30 PM
 
users with admin accounts are in the sudoers list. So if you log in with an admin account, just do sudo -s and then enter your password, you'll get a root shell.

If you're logged on as a non-admin user, either sudo to an admin user *first* or modify the /etc/sudoers file. Put the user's short name in there. Of course, to edit /etc/sudoers, you must be root ;-)
     
Dedicated MacNNer
Join Date: Mar 2005
Location: Netherlands
Status: Offline
Reply With Quote
Apr 26, 2007, 12:39 PM
 
Originally Posted by CatOne View Post
users with admin accounts are in the sudoers list. So if you log in with an admin account, just do sudo -s and then enter your password, you'll get a root shell.

If you're logged on as a non-admin user, either sudo to an admin user *first* or modify the /etc/sudoers file. Put the user's short name in there. Of course, to edit /etc/sudoers, you must be root ;-)
Done that, ntfs-3g works great
Apple Powerbook 17" 1,67 GHz, 2 gig RAM, 100 gig HDD, ATI Mobility Radeon 9700 128MB, Superdrive 8X
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:11 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2