:/home/docker$ su -
Password:
su: Authentication failure
:/home/docker$ sudo passwd root
New password:
Retype new password:
passwd: password updated successfully
:/home/docker$ sudo vi /etc/ssh/sshd_config
PermitRootLogin의 주석을 해제하고 yes로 설정함
#PermitRootLogin prohibit 어쩌고~~를
PermitRootLogin yes <- 이렇게
:/home/docker$ sudo mkdir /root/.ssh
mkdir: cannot create directory ‘/root/.ssh’: File exists
인증 키 복사
:/home/docker$ sudo cp /home/내계정입력하자/.ssh/authorized_keys /root/.ssh (난 ubuntu였다)
sshd 서비스 재실행
:/home/docker$ sudo systemctl restart sshd
switch user 실행
:/home/docker$ su - root
Password:
성공
root@ip-*---:~#