【发布时间】:2015-05-23 10:47:06
【问题描述】:
我有一个 Ubuntu 服务器,有两个用户:user1 和 user2。我在本地生成了一个 SSH 密钥并将公共部分复制到两个用户的 authorized_keys 文件中。我能够以两个用户的身份登录:
srimanth@local:~$ ssh user1@server
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-31-generic x86_64)
...
Last login: Fri Mar 20 04:11:08 2015 from A.B.C.D
user1@server:~$
srimanth@local:~$ ssh user2@server
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-31-generic x86_64)
...
Last login: Thu Mar 19 22:45:26 2015 from A.B.C.D
user2@server:~$
但是,如果我不提用户名认证失败:
srimanth@local:~$ ssh -v server
...
debug1: Connection established.
debug1: identity file /home/srimanth/.ssh/id_rsa type -1
...
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: srimanth@local
debug1: Trying private key: /home/srimanth/.ssh/id_rsa
...
debug1: No more authentication methods to try.
Permission denied (publickey).
请帮我解决这个问题。
【问题讨论】:
标签: authentication ubuntu ssh