■ sudo 명령 사용시 패스워드 입력없이 사용하는 방법을 보여준다.
1. CTRL + ALT + T 키를 눌러서 [터미널]을 실행한다.
2. [터미널]에서 아래 명령을 실행한다.
▶ 실행 명령
1 2 3 |
sudo nano /etc/sudoers |
3. /etc/sudoers 파일에서 특정 사용자에 대한 패스워드 입력 생략 설정을 추가하고 저장한다.
▶ 파일 편집
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin" # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL king ALL=NOPASSWD:ALL # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d |
※ 위의 경우 king 사용자 계정에 대해 패스워드 입력 생략 설정을 추가하였다.