root 비밀번호 설정
sudo passwd root
/etc/ssh/sshd_config 파일 열어서 아래와 같이 설정
PermitRootLogin yes
PasswordAuthentication yes
cloud에서 vm을 생성한 경우 다른 ssh 파일이 위 설정을 덮어 씌울수도 있다. 다른 ssh 파일이 있는지 확인
sshd -T | grep passwordauthentication
sshd -T | grep permitrootlogin
아래와 같이 떠야 함
passwordauthentication yes
permitrootlogin yes
하나라도 no라고 뜰 경우, 어떤 파일이 덮어씌우는 지 확인해서 해당 파일 수정하기(Cloud에서 생생성한 VM일 경우, /etc/ssh/sshd_config.d/60-cloudimg-settings.conf 이런 파일들이 덮어씌우고 있을 확률이 높음)
grep -r PasswordAuthentication /etc/ssh/
사용자에게 root 권한(=sudo 권한) 을 부여
sudo usermod -aG sudo ubuntu
sudo 그룹 전체에 NOPASSWD 설정
sudo visudo
# %sudo ALL=(ALL:ALL) ALL
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
sshd 재시작
sudo systemctl restart ssh