728x90
sudo 사용법
sudo 패키지 확인
rpm -qa | grep sudo
$ rpm -qa | grep sudo
sudo-1.6.7p5-30.1.3
sudo 설정 파일 확인
vim /etc/sudoers
$ cat /etc/sudoers
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# User privilege specification
root ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
sudo 설정 파일 편집
- visudo 명령어로 파일 편집하면 문법체크까지 해준다.
- scbyun ALL=(ALL) NOPASSWD: ALL
visudo
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# User privilege specification
root ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
scbyun ALL=(ALL) NOPASSWD: ALL
scbyun 계정에 모든 권한을 부여하고 있다.
scbyun 계정으로 로그인 한다.
sudo reboot
728x90
'리눅스' 카테고리의 다른 글
[리눅스] ubuntu에 pacemaker VirtualIP(VIP) 구성하기 (0) | 2023.02.07 |
---|---|
[리눅스] ubuntu에 pacemaker 구성하기 (0) | 2023.02.07 |
[리눅스] date 명령어 (0) | 2023.02.03 |
[리눅스] 유닉스 타임스탬프 변환기(unix timestamp converter) (0) | 2023.02.03 |
[스크립트] What Is My IP?(myip) (0) | 2023.02.03 |