Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ssh复制id后ssh仍在请求密码_Ssh - Fatal编程技术网

ssh复制id后ssh仍在请求密码

ssh复制id后ssh仍在请求密码,ssh,Ssh,现在尝试登录到计算机,使用:ssh'root@192.168.1.215“并检查以确保仅添加了所需的密钥 [root@spectrumscale ~]# chmod 700 .ssh [root@spectrumscale ~]# cd .ssh [root@spectrumscale .ssh]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/ro

现在尝试登录到计算机,使用:
ssh'root@192.168.1.215“
并检查以确保仅添加了所需的密钥

[root@spectrumscale ~]# chmod 700 .ssh
[root@spectrumscale ~]# cd .ssh
[root@spectrumscale .ssh]# ssh-keygen -t rsa 
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
05:63:ff:2a:82:fc:c9:31:87:fc:a1:61:dc:4e:5a:52 root@spectrumscale
The key's randomart image is:
+--[ RSA 2048]----+
|        +        |
|       . +       |
|          o      |
|         . .     |
|        E   .    |
|   . + +   .     |
|    o @ B .      |
|     + / o       |
|      * o        |
+-----------------+
[root@spectrumscale .ssh]#  ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.1.215
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.1.215's password: 
Permission denied, please try again.
root@192.168.1.215's password: 

Number of key(s) added: 1

您还需要在服务器上配置sshd守护进程,以使用密钥进行身份验证(并禁用密码访问)。internet上的许多教程,例如编辑,使代码和问题更具可读性!ssh对文件和目录的权限很挑剔,我不确定
ssh copy id
是否在权限过大的情况下解决了这一问题。请尝试以下方法:
ssh 192.168.1.215'mkdir-p.ssh;chmod go-w..ssh;chmod ugo-x,go-w.ssh/authorized_key'堆栈溢出是一个用于编程和开发问题的站点。您可能应该使用上的另一个站点来解决此问题。另请参见帮助中心中的。您在
/var/log/auth.log
中看到了什么?您还需要在服务器上配置sshd守护进程以使用密钥进行身份验证(并禁用密码访问)。internet上的许多教程,例如编辑,使代码和问题更具可读性!ssh对文件和目录的权限很挑剔,我不确定
ssh copy id
是否在权限过大的情况下解决了这一问题。请尝试以下方法:
ssh 192.168.1.215'mkdir-p.ssh;chmod go-w..ssh;chmod ugo-x,go-w.ssh/authorized_key'堆栈溢出是一个用于编程和开发问题的网站。您可能应该使用上的另一个网站来解决此问题。另请参见帮助中心。您在
/var/log/auth.log
[root@spectrumscale .ssh]# ssh 192.168.1.215
root@192.168.1.215's password: 
Last failed login: Tue Nov 12 17:47:37 IST 2019 from 192.168.1.203 on ssh:notty
There was 1 failed login attempt since the last successful login.
Last login: Tue Nov 12 14:44:01 2019 from localhost