2013-10-27 36 views
0

我正在使用Ubuntu 12.04(桌面)並安裝在它的ssh上。我想遠程使用我的筆記本電腦(win8 64)訪問我的桌面資源。在我的筆記本電腦上,我安裝了cygwin。當我在家中使用它時,通過我的私人網絡,一切都完美無缺 - 沒有密碼驗證,權限被拒絕等問題。當我試圖遠程連接到我的桌面時,問題就開始了。爲了檢查我的路由器IP,我使用了whatismyipadress.com網站。我想我正確地轉發了我的端口22。我打它與這樣的方式:與ssh的遠程連接 - 權限被拒絕

  1. 須藤啓動SSH(我的桌面上)
  2. SSH -vv -p 22庫圖@ ipadressofrouter

我得到了這樣的信息從我的cygwin終端

OpenSSH_6.3, OpenSSL 1.0.1e 11 Feb 2013 
debug1: Reading configuration data /home/Krystyna/.ssh/config 
debug2: ssh_connect: needpriv 0 
debug1: Connecting to 82.160.125.184 [82.160.125.184] port 22. 
debug1: Connection established. 
debug1: identity file /home/Krystyna/.ssh/id_rsa type -1 
debug1: identity file /home/Krystyna/.ssh/id_rsa-cert type -1 
debug1: identity file /home/Krystyna/.ssh/id_dsa type -1 
debug1: identity file /home/Krystyna/.ssh/id_dsa-cert type -1 
debug1: identity file /home/Krystyna/.ssh/id_ecdsa type -1 
debug1: identity file /home/Krystyna/.ssh/id_ecdsa-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_6.3 
debug1: Remote protocol version 1.99, remote software version OpenSSH_2.3.0_Mikrotik_v2.9 
debug1: match: OpenSSH_2.3.0_Mikrotik_v2.9 pat OpenSSH_2.3.0* 
debug2: fd 3 setting O_NONBLOCK 
debug2: Original cipher proposal: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] 
debug2: Compat cipher proposal: arcfour256,arcfour128,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,[email protected] 
debug2: Original cipher proposal: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] 
debug2: Compat cipher proposal: arcfour256,arcfour128,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,[email protected] 
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],ssh-dss,[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa 
debug2: kex_parse_kexinit: arcfour256,arcfour128,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,[email protected] 
debug2: kex_parse_kexinit: arcfour256,arcfour128,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,[email protected] 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,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: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1 
debug2: kex_parse_kexinit: ssh-dss 
debug2: kex_parse_kexinit: 3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes128-cbc,aes192-cbc,aes256-cbc,rijndael128-cbc,rijndael192-cbc,rijndael256-cbc,[email protected] 
debug2: kex_parse_kexinit: 3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes128-cbc,aes192-cbc,aes256-cbc,rijndael128-cbc,rijndael192-cbc,rijndael256-cbc,[email protected] 
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5,[email protected] 
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5,[email protected] 
debug2: kex_parse_kexinit: none,zlib 
debug2: kex_parse_kexinit: none,zlib 
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 3des-cbc hmac-md5 none 
debug2: mac_setup: found hmac-md5 
debug1: kex: client->server 3des-cbc hmac-md5 none 
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST_OLD(2048) sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP 
debug2: dh_gen_key: priv key bits set: 208/384 
debug2: bits set: 478/1024 
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent 
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY 
debug1: Server host key: DSA 7f:74:c1:be:c8:9f:12:b0:44:dd:58:ed:9f:83:2d:8e 
debug1: Host '82.160.125.184' is known and matches the DSA host key. 
debug1: Found key in /home/Krystyna/.ssh/known_hosts:2 
debug2: bits set: 527/1024 
debug1: ssh_dss_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/Krystyna/.ssh/id_rsa (0x0), 
debug2: key: /home/Krystyna/.ssh/id_dsa (0x0), 
debug2: key: /home/Krystyna/.ssh/id_ecdsa (0x0), 
debug1: Authentications that can continue: publickey,password 
debug1: Next authentication method: publickey 
debug1: Trying private key: /home/Krystyna/.ssh/id_rsa 
debug1: Trying private key: /home/Krystyna/.ssh/id_dsa 
debug1: Trying private key: /home/Krystyna/.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. 
[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. 

我的sshd_config文件:

# Package generated configuration file 
# See the sshd_config(5) manpage for details 
# What ports, IPs and protocols we listen for 
Port 22 
# Use these options to restrict which interfaces/protocols sshd will bind to 
#ListenAddress :: 
#ListenAddress 0.0.0.0 
Protocol 2 
# HostKeys for protocol version 2 
HostKey /etc/ssh/ssh_host_rsa_key 
HostKey /etc/ssh/ssh_host_dsa_key 
HostKey /etc/ssh/ssh_host_ecdsa_key 
#Privilege Separation is turned on for security 
UsePrivilegeSeparation yes 
# Lifetime and size of ephemeral version 1 server key 
KeyRegenerationInterval 3600 
ServerKeyBits 768 
# Logging 
SyslogFacility AUTH 
LogLevel INFO 
# Authentication: 
LoginGraceTime 120 
PermitRootLogin yes 
StrictModes yes 
RSAAuthentication no 
PubkeyAuthentication no 
#AuthorizedKeysFile  %h/.ssh/authorized_keys 
# Don't read the user's ~/.rhosts and ~/.shosts files 
IgnoreRhosts yes 
# For this to work you will also need host keys in /etc/ssh_known_hosts 
RhostsRSAAuthentication no 
# similar for protocol version 2 
HostbasedAuthentication no 
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication 
#IgnoreUserKnownHosts yes 
# To enable empty passwords, change to yes (NOT RECOMMENDED) 
PermitEmptyPasswords no 
# Change to yes to enable challenge-response passwords (beware issues with 
# some PAM modules and threads) 
ChallengeResponseAuthentication no 
# Change to no to disable tunnelled clear text passwords 
#PasswordAuthentication yes 
# Kerberos options 
#KerberosAuthentication no 
#KerberosGetAFSToken no 
#KerberosOrLocalPasswd yes 
#KerberosTicketCleanup yes 
# GSSAPI options 
#GSSAPIAuthentication no 
#GSSAPICleanupCredentials yes 
X11Forwarding yes 
X11DisplayOffset 10 
PrintMotd no 
PrintLastLog yes 
TCPKeepAlive yes 
#UseLogin no 
#MaxStartups 10:30:60 
#Banner /etc/issue.net 
# Allow client to pass locale environment variables 
AcceptEnv LANG LC_* 
Subsystem sftp /usr/lib/openssh/sftp-server 
# Set this to 'yes' to enable PAM authentication, account processing, 
# and session processing. If this is enabled, PAM authentication will 
# be allowed through the ChallengeResponseAuthentication and 
# PasswordAuthentication. Depending on your PAM configuration, 
# PAM authentication via ChallengeResponseAuthentication may bypass 
# the setting of "PermitRootLogin without-password". 
# If you just want the PAM account and session checks to run without 
# PAM authentication, then enable this but set PasswordAuthentication 
# and ChallengeResponseAuthentication to 'no'. 
UsePAM no 

Thx任何提示提前。

回答

0

如何生成公鑰? 也許試試ssh-key -t rsa