1. ssh root 접속 차단
[root@localhost ~]# vi /etc/ssh/sshd_config
:
PermitRootLogin no <= 주석 제거하고 yes를 no로 변경
:wq! <= 저장
>>서비스 재시작
[root@localhost ~]# service sshd restart
2. sudo 설정
[root@localhost ~]# vi /etc/sudoers
:
:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
jonny ALL=(ALL) ALL <= 사용자 추가
# 패스워드 물어보지 않게 하기
## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL <= 주석 제거
:
:wq! <= 저장
>> wheel 그룹에 sudo 사용자 추가
[root@localhost ~]# vi /etc/group
root:x:0:root
:
:
wheel:x:10:root,jonny <= sudo 사용할 jonny 추가
:
:
jonny:x:500:
:wq! <= 저장