
저는 Ubuntu 서버에서 Discourse 포럼 소프트웨어 컨테이너를 실행하고 있으며 이 명령을 사용하여 컨테이너에 로그인할 수 있습니다.
sudo docker exec -it 애플리케이션 bash
그런 다음 루트 사용자의 비밀번호를 설정했지만 ssh가 예상대로 작동하지 않아 항상 잘못된 비밀번호를 받았습니다.
SSH 디버그 로그
Set /proc/self/oom_score_adj to 0
debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8
debug1: inetd sockets after dupping: 3, 3
Connection from ::1 port 45924 on ::1 port 22
debug1: Client protocol version 2.0; client software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: permanently_set_uid: 105/65534 [preauth]
debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: client->server aes128-ctr [email protected] none [preauth]
debug1: kex: server->client aes128-ctr [email protected] none [preauth]
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user root service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: PAM: initializing for "root"
debug1: PAM: setting PAM_RHOST to "localhost"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: userauth-request for user root service ssh-connection method password [preauth]
debug1: attempt 1 failures 0 [preauth]
pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=localhost user=root
debug1: PAM: password authentication failed for root: Authentication failure
Failed password for root from ::1 port 45924 ssh2
Excess permission or bad ownership on file /var/log/btmp
Connection closed by ::1 [preauth]
debug1: do_cleanup [preauth]
debug1: monitor_read_log: child log fd closed
debug1: do_cleanup
debug1: PAM: cleanup
debug1: Killing privsep child 32712
조언해주세요.
답변1
이제 이 문제가 해결되었습니다.
Discourse SSH 컨테이너 구성에 문제가 있는 것 같습니다.
/etc/ssh/sshd_config에서
PermitRootLogin without-password
나는 그것을 다음과 같이 바꿨다.
PermitRootLogin yes
#PermitRootLogin without-password
이로써 문제가 해결되었습니다.
답변2
로그 파일에 붙여넣으려면 코드 태그를 사용해야 하지만, 제가 아는 한:
sshd[32711]: debug1: PAM: password authentication
failed for root: Authentication failure Aug 26 20:32:29
관련성이 있는 것 같습니다. Docker 이미지의 루트 사용자가 올바른 비밀번호를 사용하고 있습니까?
또한 sshd_config를 다시 로드할 수 있도록 sshd 서비스(docker 이미지에서)를 다시 시작했습니까?