想用ssh科学上网,但是显示 Permission denied (publickey).
- jinhongchao@gmail.com
- 帖子: 286
- 注册时间: 2008-06-24 21:00
想用ssh科学上网,但是显示 Permission denied (publickey).
想用ssh科学上网,但是一直连不上.头大了,搜了两天也没解决问题.请高手指教一下.
ssh -v -N -D 7070 guest:guest2421153442060@s4.alidage.org
OpenSSH_6.9p1 Ubuntu-2, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to s4.alidage.org [178.79.149.154] port 22.
debug1: Connection established.
debug1: identity file /home/jin/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jin/.ssh/id_rsa-cert type -1
debug1: identity file /home/jin/.ssh/id_dsa type 2
debug1: key_load_public: No such file or directory
debug1: identity file /home/jin/.ssh/id_dsa-cert type -1
debug1: identity file /home/jin/.ssh/id_ecdsa type 3
debug1: key_load_public: No such file or directory
debug1: identity file /home/jin/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/jin/.ssh/id_ed25519 type 4
debug1: key_load_public: No such file or directory
debug1: identity file /home/jin/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9p1 Ubuntu-2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to s4.alidage.org:22 as 'guest:guest2421153442060'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:aDNTgyuuTiWCSjxcrVM6wqd0D8XVJLtHrymDR3xPJbY
debug1: Host 's4.alidage.org' is known and matches the ECDSA host key.
debug1: Found key in /home/jin/.ssh/known_hosts:1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering DSA public key: /home/jin/.ssh/id_dsa
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /home/jin/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering ECDSA public key: /home/jin/.ssh/id_ecdsa
debug1: Authentications that can continue: publickey
debug1: Offering ED25519 public key: /home/jin/.ssh/id_ed25519
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
ssh -v -N -D 7070 guest:guest2421153442060@s4.alidage.org
OpenSSH_6.9p1 Ubuntu-2, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to s4.alidage.org [178.79.149.154] port 22.
debug1: Connection established.
debug1: identity file /home/jin/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jin/.ssh/id_rsa-cert type -1
debug1: identity file /home/jin/.ssh/id_dsa type 2
debug1: key_load_public: No such file or directory
debug1: identity file /home/jin/.ssh/id_dsa-cert type -1
debug1: identity file /home/jin/.ssh/id_ecdsa type 3
debug1: key_load_public: No such file or directory
debug1: identity file /home/jin/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/jin/.ssh/id_ed25519 type 4
debug1: key_load_public: No such file or directory
debug1: identity file /home/jin/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9p1 Ubuntu-2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to s4.alidage.org:22 as 'guest:guest2421153442060'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:aDNTgyuuTiWCSjxcrVM6wqd0D8XVJLtHrymDR3xPJbY
debug1: Host 's4.alidage.org' is known and matches the ECDSA host key.
debug1: Found key in /home/jin/.ssh/known_hosts:1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering DSA public key: /home/jin/.ssh/id_dsa
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /home/jin/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering ECDSA public key: /home/jin/.ssh/id_ecdsa
debug1: Authentications that can continue: publickey
debug1: Offering ED25519 public key: /home/jin/.ssh/id_ed25519
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: 想用ssh科学上网,但是显示 Permission denied (publickey).
https://help.ubuntu.com/community/SSH/O ... leshootingPermission denied (publickey)
Permission denied (publickey)
目錄權限 需要設定為 600
檔案權限 需要設定為 700
意思是 除了登入的使用者以外 其它使用者都沒有權限存取/瀏覽/執行 才不會出現這個錯誤訊息
- jinhongchao@gmail.com
- 帖子: 286
- 注册时间: 2008-06-24 21:00
Re: 想用ssh科学上网,但是显示 Permission denied (publickey).
谢谢,不过权限设定是无误的.poloshiao 写了:https://help.ubuntu.com/community/SSH/O ... leshootingPermission denied (publickey)
Permission denied (publickey)
目錄權限 需要設定為 600
檔案權限 需要設定為 700
意思是 除了登入的使用者以外 其它使用者都沒有權限存取/瀏覽/執行 才不會出現這個錯誤訊息
会不会是因为帐号名有关啊.
ssh -v -N -D 7070 guest@s4.alidage.org 也不会提示输入密码.
用密码也不能登录的.
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: 想用ssh科学上网,但是显示 Permission denied (publickey).
把下面指令 複製 貼進終端機 執行不过权限设定是无误的.
sudo ls -al /home | grep jin
sudo ls -al /home/jin | grep ssh
sudo ls -al /home/jin/.ssh | grep authorized_keys
把結果直接 選取/複製 貼上來
- jinhongchao@gmail.com
- 帖子: 286
- 注册时间: 2008-06-24 21:00
Re: 想用ssh科学上网,但是显示 Permission denied (publickey).
jin@jin-X201s:~$ sudo ls -al /home/jin | grep sshpoloshiao 写了:把下面指令 複製 貼進終端機 執行不过权限设定是无误的.
sudo ls -al /home | grep jin
sudo ls -al /home/jin | grep ssh
sudo ls -al /home/jin/.ssh | grep authorized_keys
把結果直接 選取/複製 貼上來
-rw------- 1 jin jin 48 11月 19 23:21 .lesshst
drwx------ 2 jin jin 4096 12月 1 21:54 .ssh
jin@jin-X201s:~$ sudo ls -al /home/jin/.ssh | grep authorized_keys
-rw-r--r-- 1 jin jin 739 12月 1 21:50 authorized_keys
- astolia
- 论坛版主
- 帖子: 6460
- 注册时间: 2008-09-18 13:11
Re: 想用ssh科学上网,但是显示 Permission denied (publickey).
这年头了还想用22端口的ssh翻,早就被墙特征识别+阻断了
- jinhongchao@gmail.com
- 帖子: 286
- 注册时间: 2008-06-24 21:00
Re: 想用ssh科学上网,但是显示 Permission denied (publickey).
是因为端口的原因啊?astolia 写了:这年头了还想用22端口的ssh翻,早就被墙特征识别+阻断了
- astolia
- 论坛版主
- 帖子: 6460
- 注册时间: 2008-09-18 13:11
Re: 想用ssh科学上网,但是显示 Permission denied (publickey).
是你机器上没公钥。但有公钥也没戏。22端口秒杀,其他端口存活基本不会超10分钟
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: 想用ssh科学上网,但是显示 Permission denied (publickey).
需要改為sudo ls -al /home/jin/.ssh | grep authorized_keys
-rw-r--r-- 1 jin jin 739 12月 1 21:50 authorized_keys
-rw------- 1 jin jin 739 12月 1 21:50 authorized_keys
Permission denied (publickey) 訊息才會消失
- jinhongchao@gmail.com
- 帖子: 286
- 注册时间: 2008-06-24 21:00
Re: 想用ssh科学上网,但是显示 Permission denied (publickey).
改了,还是老样子.看来还是端口的问题.另外换了一个ssh服务器,用22端口就出现 Permission denied (publickey) ,poloshiao 写了:需要改為sudo ls -al /home/jin/.ssh | grep authorized_keys
-rw-r--r-- 1 jin jin 739 12月 1 21:50 authorized_keys
-rw------- 1 jin jin 739 12月 1 21:50 authorized_keys
Permission denied (publickey) 訊息才會消失
后来换了别的指定的端口,就有输入密码的提示了.也能顺利的进行了.
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: 想用ssh科学上网,但是显示 Permission denied (publickey).
改了,还是老样子.看来还是端口的问题.
你可以試試 改回后来换了别的指定的端口,就有输入密码的提示了.也能顺利的进行了.
-rw-r--r-- 1 jin jin 739 12月 1 21:50 authorized_keys
看看 有何改變