You are not logged in.

#26 2007-06-26 23:27:42

big_gie
Member
Registered: 2005-01-19
Posts: 637

Re: Sudo

I prefer using sudo on my computer without anybody else using it. That way, to execute a command which could break something I need to add "sudo" before.
As KerowynM said, if you _always_ add sudo before the command, its useless.

Offline

#27 2007-06-28 21:24:33

cry0x
Member
Registered: 2007-04-11
Posts: 91

Re: Sudo

I love sudo. Besides package management, once my system is setup, I don't really do much as root. So, root is disabled, and my user account has a secure password. If I need to do a whole batch of commands as root, just sudo -s.

Like many have said, sudo prevents me from forgetting to logout as root.

Last edited by cry0x (2007-06-28 21:25:11)


Who is this doin' this synthetic type of alpha beta psychedelic funkin'?

Offline

#28 2007-07-11 08:26:41

Ikarus
Member
From: Germany
Registered: 2007-07-05
Posts: 41

Re: Sudo

As long as i'am the only one who uses my box i stay with su. For multiple users i would prefer sudo.

Offline

#29 2007-07-11 08:59:50

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Sudo

don't know how stupid that is, but I use sudo to keep using the same configurations, eg ~/.zshrc , ~/.vimrc , ... when doing privileged operations,
like installing a package (zsh completion) or editing a file in /etc/ (vim config), etc


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#30 2007-07-15 10:26:42

mosor
Member
Registered: 2007-04-02
Posts: 22

Re: Sudo

The fastest and most productive for myself is to disable root loogin, setup sudo to ask for no password, alias 'sudo' to 's', and just prefix all commands that require root access with 's'. That way I can use my zsh, vim, etc... settings. Used together with zshs' reverse history search feature, I can't remember the last time I typed a command longer that 2 or 3 letters wink.

Offline

#31 2007-07-15 12:26:38

Ankka
Member
From: Finland
Registered: 2007-04-08
Posts: 98

Re: Sudo

I have set up sudo almost like ubuntu has: no root account and sudo asks for a password.

Nice and secure. If I want to do something with sudo, I need to put my password in.. and have that second of time to think what I'm doing.

Offline

#32 2007-07-15 12:53:16

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Sudo

skymt wrote:
The_ouroboros wrote:
skymt wrote:

I've disabled the timeout completely in my sudo configuration file.

how you did it?

1. Log in as root (su, sudo -s, whatever).
2. # cp /etc/sudoers /etc/sudoers.temp
3. Edit /etc/sudoers.temp with your favorite editor
4. Add this line under the "Defaults specification" comment:

Defaults    timestamp_timeout=0

5. Save the file, quit your editor
6. # visudo -c -f /etc/sudoers.temp
7. # mv -f /etc/sudoers.temp /etc/sudoers

This method of editing the file is more convoluted than it needs to be, but sudo breaks if there's an error in the sudoers file, so it's best to err on the side of caution.

which is why you're meant to edit the file by running "visudo" -- not editing manually -- as it checks for errors in the file, and alerts you.

James

Offline

#33 2007-07-15 17:57:50

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Sudo

mosor wrote:

The fastest and most productive for myself is to disable root loogin, setup sudo to ask for no password, alias 'sudo' to 's', and just prefix all commands that require root access with 's'. That way I can use my zsh, vim, etc... settings. Used together with zshs' reverse history search feature, I can't remember the last time I typed a command longer that 2 or 3 letters wink.

How did you manage to disable the password? I tried to follow the Arch wiki, but it keeps asking me for a password every time...

Thanks smile


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#34 2007-07-15 18:52:09

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Sudo

finferflu wrote:
mosor wrote:

The fastest and most productive for myself is to disable root loogin, setup sudo to ask for no password, alias 'sudo' to 's', and just prefix all commands that require root access with 's'. That way I can use my zsh, vim, etc... settings. Used together with zshs' reverse history search feature, I can't remember the last time I typed a command longer that 2 or 3 letters wink.

How did you manage to disable the password? I tried to follow the Arch wiki, but it keeps asking me for a password every time...

Thanks smile

hmm? It's already in there :

# Same thing without a password
# %wheel    ALL=(ALL)    NOPASSWD: ALL

You just have to decomment that line using visudo.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#35 2007-07-15 19:08:17

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: Sudo

iphitus wrote:

which is why you're meant to edit the file by running "visudo" -- not editing manually -- as it checks for errors in the file, and alerts you.

James

visudo uses the vi editor by default, which many users don't know. It doesn't even respect the $EDITOR env variable, instead using a variable in the sudoers file. This effectively locks out newbies, as you have to use vi to tell visudo to open an editor other than vi (catch-22!). Step 6 in the method I laid out uses visudo to do a syntax check before committing the changes by overwriting the sudoers file, so there would be no real benefit to just using visudo to edit it.

Offline

#36 2007-07-15 20:26:08

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Sudo

@ shining

Thanks for you help... I was so busy following the wiki that I completely overlooked the sudoers file...


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

Board footer

Powered by FluxBB