Linux2010. 2. 4. 20:58
sudo는 debian이던, fedora던 존재하지만,
아무튼, 일시적으로 root의 권한을 지니게하고 일반적으로 root의 행동은 log에 남지 않지만
sudo를 통해서 작업하면 로그로도 남기기 때문에 상대적으로 보안이 좀더 강화된다.

아무튼,
페도라에서는 su 로 root 쉘을 사용하지만
우분투에서는 sudo 로 일시적으로 상승시켜 명령을 실행한다.

물론 sudo -i 라는 명령을 이용해서 루트 쉘로 이동할수는 있다.
페도라의 su 명령어는 디렉토리가 변경되지 않는 반면,
우분투의 sudo -i 는 root의 홈 디렉토리(일반적으로 /root)로 이동한다.
sudo -isu - 와 동일한 느낌이다.

sudo -K | -L | -V | -h | -k | -l | -v
sudo [-HPSb] [-a auth_type] [-c class|-] [-p prompt] [-u username|#uid] {-e file [...] | -i | -s | command}

-i

The -i (simulate initial login) option runs the shell specified in the passwd(5) entry of the user that the command is being run as. The command name argument given to the shell begins with a - to tell the shell to run as a login shell. sudo attempts to change to that user's home directory before running the shell. It also initializes the environment, leaving TERM unchanged, setting HOME , SHELL , USER , LOGNAME , and PATH , and unsetting all other environment variables. Note that because the shell to use is determined before the sudoers file is parsed, a runas_default setting in sudoers will specify the user to run the shell as but will not affect which shell is actually run.

[링크 : http://linux.die.net/man/8/sudo]


기본 sudoers 파일 내용
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults    env_reset

# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
 
[링크 : https://help.ubuntu.com/community/Sudoers]  

Posted by 구차니