2014-04-09 48 views
-1

我刚刚在AWS EC2上创建了一个实例。我得到了ec2用户的pub/private密钥,我可以使用我的Windows机器上的puTTY客户端登录。AWS:为我的用户添加SSH密钥

现在,我想用新用户(xxxx)连接到同一个实例。对于:

  • 首先,我用“useradd的”关于AWS实例创建的用户
  • 生成酒吧/私人使用PuTTYgen
  • 复制酒馆重点内容,以我的Windows机器>> /root/.ssh上的按键/ authorized_keys文件。现在
  • ,我试图用腻子使用私钥

连接,但我无法登录,而且我得到了以下错误:

Authentication log (see session log for details): 
Using username "xxxx". 
Server refused our key 
No supported authentication methods left to try! 

Connection has been unexpectedly closed. Server sent command exit status 0. 

回答

0

我能够通过在xxxx用户主目录(/home/xxxx/.ssh/authorized_keys)下创建authorized_keys文件来解决此问题,而不是/root/.ssh/authorized_keys