GOOD4ME

[Ubuntu] ssh permission denied 오류 본문

개발.오류.정리/ETC.

[Ubuntu] ssh permission denied 오류

de_youn 2023. 1. 3. 16:06
반응형

 

$ scp -P 8118 test.txt root@spark_master:/home/

상기처럼 Docker 기반의 컨테이너 간
파일을 송/수신하려고 하는데
ssh permission denied 오류가 발생하였다.

단순히 ssh permission denied 오류가 발생한다면
그건 패스워드를 잘못 입력한 것이니
패스워드를 다시 확인해야한다.

그러나 ssh permission denied (publickey, password) 라는 오류가 발생한다면
파일을 수신하는 측의 sshd_config 파일을 수정해야한다.

# sshd_config 파일 수정
$ vi /etc/ssh/sshd_config
~
#PermitRootLogin prohibit-password
PermitRootLogin yes
~
#PasswordAuthentication no
PasswordAuthentication yes
~
#UseLogin no
UseLogin yes
~

# root 비밀번호 설정
$ passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

# ssh 서비스 재시작
# restart 시, stuck 현상이 일어날 가능성이 있으니
# 하단처럼 종료 후, 시작하는 것을 추천
$ service ssh stop
 * Stopping OpenBSD Secure Shell server sshd                                    [ OK ]
$ service ssh start
 * Starting OpenBSD Secure Shell server sshd     
 /etc/ssh/sshd_config line 96: Deprecated option UseLogin                       [ OK ]

 

상기처럼 파일 수정
root 비밀번호 변경, ssh 서비스 재시작 결과
scp 명령어가 잘 먹히는 것을 확인할 수 있었다.😁

반응형
Comments