想用ssh科学上网,但是显示 Permission denied (publickey).

其它类软件,非上述版软件
回复
头像
jinhongchao@gmail.com
帖子: 286
注册时间: 2008-06-24 21:00

想用ssh科学上网,但是显示 Permission denied (publickey).

#1

帖子 jinhongchao@gmail.com » 2015-12-01 19:06

想用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).
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 想用ssh科学上网,但是显示 Permission denied (publickey).

#2

帖子 poloshiao » 2015-12-01 20:16

Permission denied (publickey)
https://help.ubuntu.com/community/SSH/O ... leshooting
Permission denied (publickey)
目錄權限 需要設定為 600
檔案權限 需要設定為 700
意思是 除了登入的使用者以外 其它使用者都沒有權限存取/瀏覽/執行 才不會出現這個錯誤訊息
头像
jinhongchao@gmail.com
帖子: 286
注册时间: 2008-06-24 21:00

Re: 想用ssh科学上网,但是显示 Permission denied (publickey).

#3

帖子 jinhongchao@gmail.com » 2015-12-01 22:07

poloshiao 写了:
Permission denied (publickey)
https://help.ubuntu.com/community/SSH/O ... leshooting
Permission denied (publickey)
目錄權限 需要設定為 600
檔案權限 需要設定為 700
意思是 除了登入的使用者以外 其它使用者都沒有權限存取/瀏覽/執行 才不會出現這個錯誤訊息
谢谢,不过权限设定是无误的.
会不会是因为帐号名有关啊.
ssh -v -N -D 7070 guest@s4.alidage.org 也不会提示输入密码.
用密码也不能登录的.
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 想用ssh科学上网,但是显示 Permission denied (publickey).

#4

帖子 poloshiao » 2015-12-01 23:33

不过权限设定是无误的.
把下面指令 複製 貼進終端機 執行
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).

#5

帖子 jinhongchao@gmail.com » 2015-12-02 17:14

poloshiao 写了:
不过权限设定是无误的.
把下面指令 複製 貼進終端機 執行
sudo ls -al /home | grep jin
sudo ls -al /home/jin | grep ssh
sudo ls -al /home/jin/.ssh | grep authorized_keys
把結果直接 選取/複製 貼上來
jin@jin-X201s:~$ sudo ls -al /home/jin | grep ssh
-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
论坛版主
帖子: 6454
注册时间: 2008-09-18 13:11

Re: 想用ssh科学上网,但是显示 Permission denied (publickey).

#6

帖子 astolia » 2015-12-02 17:43

这年头了还想用22端口的ssh翻,早就被墙特征识别+阻断了
头像
jinhongchao@gmail.com
帖子: 286
注册时间: 2008-06-24 21:00

Re: 想用ssh科学上网,但是显示 Permission denied (publickey).

#7

帖子 jinhongchao@gmail.com » 2015-12-02 18:39

astolia 写了:这年头了还想用22端口的ssh翻,早就被墙特征识别+阻断了
是因为端口的原因啊?
头像
astolia
论坛版主
帖子: 6454
注册时间: 2008-09-18 13:11

Re: 想用ssh科学上网,但是显示 Permission denied (publickey).

#8

帖子 astolia » 2015-12-02 18:53

是你机器上没公钥。但有公钥也没戏。22端口秒杀,其他端口存活基本不会超10分钟
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 想用ssh科学上网,但是显示 Permission denied (publickey).

#9

帖子 poloshiao » 2015-12-02 20:55

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).

#10

帖子 jinhongchao@gmail.com » 2015-12-02 23:07

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) 訊息才會消失
改了,还是老样子.看来还是端口的问题.另外换了一个ssh服务器,用22端口就出现 Permission denied (publickey) ,
后来换了别的指定的端口,就有输入密码的提示了.也能顺利的进行了.
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 想用ssh科学上网,但是显示 Permission denied (publickey).

#11

帖子 poloshiao » 2015-12-03 4:59

改了,还是老样子.看来还是端口的问题.
后来换了别的指定的端口,就有输入密码的提示了.也能顺利的进行了.
你可以試試 改回
-rw-r--r-- 1 jin jin 739 12月 1 21:50 authorized_keys
看看 有何改變
回复