如何添加SSH密钥? [英] How can I add SSH key?

查看:1041
本文介绍了如何添加SSH密钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将远程服务器的Linux SSH密钥添加到本地Linux机箱。 SSH服务器的IP地址是192.168.2.3



我尝试了什么:



How can I add Linux SSH keys of the remote server to my local Linux box. The SSH server IP address is 192.168.2.3

What I have tried:

How can I add Linux SSH keys of the remote server to my local Linux box. The SSH server IP address is 192.168.2.3

推荐答案

您应该可以使用 ssh-copy-id user @ host 这会将您的ssh-key从当前系统复制到 host 。如果您的 .ssh 文件夹中有多个密钥,或通过ssh-add添加,您可以使用选择要复制的密钥-i 选项。 E,B ssh-copy-id~ / .ssh / id_ecdsa user @ host



如果您没有ssh-copy-id,则必须手动复制密钥

You should be able to use ssh-copy-id user@host That will copy your ssh-key from the current system to host. If you have more than one key in your .ssh folder, or added via ssh-add, you can select the key you wish to copy using the -i option. e.b. ssh-copy-id ~/.ssh/id_ecdsa user@host

If you don't have ssh-copy-id, you'll have to copy the key manually
localhost

scp~ / .ssh / id_ecdsa.pub user @ remote:
localhost
scp ~/.ssh/id_ecdsa.pub user@remote: localhost


ssh user @ remote
user @ remote的密码:

remotehost
ssh user@remote user@remote‘s password: remotehost


这篇关于如何添加SSH密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆