내 컴퓨터에 대한 SSH 문제 해결

내 컴퓨터에 대한 SSH 문제 해결

우분투를 통해 여러 컴퓨터에 SSH로 연결한 경험이 있습니다. 그러나 어떤 이유로 동일한 네트워크에 있는 동일한 컴퓨터에서 내 컴퓨터(이 특정 컴퓨터)로 SSH를 연결할 수 없습니다. 다른 컴퓨터도 SSH로 연결할 수 있지만 특히 이 컴퓨터는 그렇지 않습니다.

내 호스트 이름(보안상의 이유로 다름)

lab.dept.uni.ece

내 계정 이름은

user

간단한 작업을 수행합니다.

ssh [email protected]

내 컴퓨터에 ssh를 연결해야 하는데 사용자 이름과 비밀번호를 입력하면 마치 내 비밀번호(또는 잠재적으로 사용자 이름?)가 잘못된 것처럼 "권한이 거부되었습니다"라는 메시지가 표시됩니다. 호스트 이름이나 사용자 이름에 대해 불평하는 것이 아니므로 그들이 옳다고 가정합니다. 확인할 수 있는 방법이 있나요? 반대로 내 컴퓨터에 일종의 SSH 블록을 설정했을 수도 있습니다.

또한, 내 연구실에 박사후 연구원이 있었는데, 그 사람이 자신의 계정에 SSH를 연결하려고 했을 때부터 내 컴퓨터에서 뭔가 이상한 일이 일어나고 있다고 나에게 말했던 것을 기억합니다. 사용자/비밀번호로) 실제로는 할 수 없었습니다.

SSH가 설치되었습니다. 이 문제를 어떻게 해결해야 하나요?

ssh -vv의 출력[이메일 보호됨]

OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to lab.dept.uni.edu [128.111.113.132] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.4
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.4
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 86:b8:8e:c5:a5:53:5a:df:26:99:0b:90:9f:4b:91:8e
debug1: Host 'lab.dept.uni.edu' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:9
debug1: ssh_ecdsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/user/.ssh/id_rsa ((nil))
debug2: key: /home/user/.ssh/id_dsa ((nil))
debug2: key: /home/user/.ssh/id_ecdsa ((nil))
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user/.ssh/id_rsa
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
[email protected]'s password: 
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.

또한 사용자 이름이 'user' 및 'User'이므로 하나는 소문자이고 다른 하나는 대문자이므로 사용자 이름이 문제가 될 수 있다고 생각했습니다. 그러나 비밀번호도 알고 있는 방금 만든 'bob'과 같은 새 사용자 이름으로 SSH를 통해 연결할 수 없기 때문에 문제가 되지 않는 것 같습니다.

답변1

당신은 클라이언트의 관점에서 이것을 보고 있지만 당신은 로그인하려는 PC의 소유자이므로 다음을 시작하여 이보다 더 나은 결과를 얻을 수 있습니다.SSH디버그 옵션이 있는 데몬:

  service ssh stop
  /usr/sbin/sshd -Dd 

(데몬이 분리되는 것을 방지합니다.디버그 모드로 전환합니다.) 이제 다른 PC에서 로그인을 시도하면 데몬의 출력과 액세스가 거부되는 이유를 확인할 수 있습니다.

오류 메시지가 표시된다는 점을 명심해야 합니다.고객 입장에서합법적인 디버깅 목적 외에도 악의적인 공격자가 의심하지 않는 피해자의 컴퓨터에 침투할 가능성을 높이기 위해 사용할 수 있기 때문에 매우 유용한 정보를 제공하려는 것은 아닙니다. 반면, 데몬 자체에 의한 디버깅 메시지는 PC 소유자만 접근할 수 있으므로 합법적인 용도로 사용됩니다. 이것이 서버측 메시지가 더 많은 정보를 제공하는 이유입니다.

이를 통해 다음 반복에서 문제를 디버깅할 수 있는 충분한 정보를 얻을 수 있기를 바랍니다.

관련 정보