介绍一个小技巧,如何实现ssh免密登录

920 阅读2分钟
原文链接: yq.aliyun.com

介绍一个小技巧,如何实现ssh免密登录

bboysoul 2018-04-27 16:24:12 浏览551 评论0

摘要: 概述 首先,说实在的,这个已经被很多人说过了,但是,我是第一次用,没错,我就是这么out 操作 首先生成一个rsa秘钥ssh-keygen -t rsa之后把这个秘钥拷贝到远程主机上,用下面这个命令就够了ssh-copy-id root@vultr.

概述

首先,说实在的,这个已经被很多人说过了,但是,我是第一次用,没错,我就是这么out

操作

首先生成一个rsa秘钥
ssh-keygen -t rsa
之后把这个秘钥拷贝到远程主机上,用下面这个命令就够了
ssh-copy-id root@vultr.bboysoul.com

  ~ ssh-copy-id root@vultr.bboysoul.com
/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@vultr.bboysoul.com's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'root@vultr.bboysoul.com'"
and check to make sure that only the key(s) you wanted were added.

之后你就可以免密登录了

欢迎关注Bboysoul的博客www.bboysoul.com
Have Fun

【云栖快讯】云栖专辑 | 阿里开发者们的20个感悟,一通百通  详情请点击 评论 (0) 点赞 (0) 收藏 (0)
分享到:

相关文章

网友评论