OS X terminal questions

Spleeze

Limp Gawd
Joined
Oct 15, 2003
Messages
433
So i was monkeying around with my ibook today, and i realized that i couldnt 'su' in the terminal, fair enough...

so i go to sudo, and it doesnt even ask for my password it just executes the command with root priviledges!

how can i make sudo as for a password, and also, is there an easy way to install su, since i'm used to using su as opposed to sudo

for example, if i type 'sudo bash' i get a root prompt without it asking for a password! this seems like a huge problem

i remember it asking some questions the first time i sudo'ed but that was a long time ago and i wasnt paying as much attention as i should have been
 
thats weird....if i type sudo bash or sudo -s im asked for a password. unless i had already used sudo recently... then it just executes the command or goes to root
 
Ok, i gave it some time, and it asked me for my password again, so i suppose there is some sort of timeout till when it will ask you again, but i'd really rather type my password everytime i sudo, or even type my password once for every terminal session, but i closed the terminal program and reopened it and it still rememberd that i had recently typed in a password

In short, i'd rather this situation not be possible, i use sudo, close the terminal and walk away, and then someone uses my computer and can sudo without a password
 
Spleeze said:
Ok, i gave it some time, and it asked me for my password again, so i suppose there is some sort of timeout till when it will ask you again, but i'd really rather type my password everytime i sudo, or even type my password once for every terminal session, but i closed the terminal program and reopened it and it still rememberd that i had recently typed in a password

In short, i'd rather this situation not be possible, i use sudo, close the terminal and walk away, and then someone uses my computer and can sudo without a password

Did you just close the terminal and not quit it? If it still shows up in your dock it's still running so you won't reset the timeout. Use command-q
 
as previously stated, sudo -s will do the same us su . They got rid of su for security reasons.
 
yeah, so i can get the same effect of su with sudo -s and sudo bash... but when i shut down the terminal program (and i'm shutting it down, not just closing the window) i can start it back up and "sudo -s" and it won't ask me for a password if i do it within whatever the given time interval is

Optimally i'd like it to ask for a password EVERY time i sudo, even if i had just sudo'ed in the same console window

but i could deal with it only asking once per instance of terminal, and then when i close and reopen it, it will ask for a password again... but this is not the current behavior

as this stands it seems like a much larger security flaw than having su

any ideas?
 
i think sudo -k will invalidate the timestamp and force sudo to ask for the password the next time.

you can also edit the sudoers file and set it to always ask for the password. i think this works in open bsd, but i'm not sure about darwin.
 
editing the sudoers file did the trick, thanks for pointing me in the right direction
 
The su command does exist, you just can't run it unless you're already root, I think. So you'll have to do sudo su.
 
su command still works you just can't su from user to root in the regular run level AFAIK.
 
Back
Top