ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

Linux配置SSH名称通信

Linux配置SSH名称通信

A主机  源端

1、执行ssh-keygen -t rsa    //生成密钥对

2、ssh-copy-id -i /root/id_rsa_host4.pub root@38.47.106.144 //将公钥传输给B主机

3、 在本机创建 SSH 别名(~/.ssh/config

把下面内容追加到 /root/.ssh/config(若不存在则新建):

 
cat >> /root/.ssh/config <<'EOF' Host host4 HostName 38.47.106.144 User root IdentityFile /root/id_rsa_host4 IdentitiesOnly yes EOF chmod 600 /root/.ssh/config

 

返回列表