3步实现ssh面密码登录
1、上次本机的公钥和私钥
[root@vicweb ~]#ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
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:
:ef:::bf::2f::8b:b8:c8:f6::::a4 root@vicweb.localdomain
The key's randomart image is:
+--[ RSA ]----+
| |
| |
| . o |
| .. * . |
| o... S . |
| .E.=. o o . |
| +o.oo = . . |
| . .. .+ o . |
| .. o. |
+-----------------+
2、查看生产的文件(非必要操作,只是确认一下)

3、把公钥传输到指定机器,需要免密码ssh登录的机器,使用ssh-copy-id命令
[root@vicweb ~]#ssh-copy-id -i ~/.ssh/id_rsa.pub root@10.10.90.102
The authenticity of host '10.10.90.102 (10.10.90.102)' can't be established.
RSA key fingerprint is ::7f::f2:c4::::2d:::::c7:.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.10.90.102' (RSA) to the list of known hosts.
root@10.10.90.102's password:
Now try logging into the machine, with "ssh 'root@10.10.90.102'", and check in: .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting.
check in到了对方的 authorized_keys文件,对方机器默认是没有这个文件的,会自动生产一个这个文件,并把自己的公钥写到这个文件
4、测试登录即可
[root@vicweb ~/.ssh]#ssh root@10.10.90.102
Last login: Thu Nov :: from 10.10.90.1
已实现自动登录,不需要在输入对方root的密码。
3步实现ssh面密码登录的更多相关文章
- 两步完成ssh免密码登录
1.生成公钥/私钥 ssh-keygen -N '' 生成公钥在/root/.ssh目录下. 2.分发公钥 ssh-copy-id root@192.168.137.141 192.168.137.1 ...
- Mac下到Linux主机ssh免密码登录
最近忙得忘乎所以,写篇博客放松放松,RT,直接上命令好了 # Local ssh-keygen -t rsa scp ~/.ssh/id_rsa.pub username@server:~/.ssh/ ...
- linux 配置ssh免密码登录
1.确保主机名唯一 主机名修改方法: a.修改/etc/sysconfig/network,HOSTNAME=想要设置的主机名称 b.修改/etc/hosts,127.0.0.1 localhos ...
- centos ssh 免密码登录
最近在学习的过程中遇到这个问题: A主机和B主机: A 免密码登录B: 首先在A的 ~/.ssh 目录中 执行 ssh-keygen -t rsa 一路回车 最后生成连个文件: 将id_rsa.pub ...
- ssh免密码登录记录
做mha.hadoop安装过程中都要用ssh免密码登陆,查过一些资料,踩过很多坑,下面用简单记录一下 首先要安装ssh linux : centOS 6.5 yum -y install *ssh* ...
- Linux下SSH免密码登录
转自:http://haitao.iteye.com/blog/1744272 ssh配置 主机A:10.0.5.199 主机B:10.0.5.198 需要配置主机A无密码登录主机A,主机B 先确保所 ...
- 多台CentOS服务器下实现SSH免密码登录
ROOT用户下实现SSH免密码登录 第一步:进入目录/root/.ssh $ cd /root/.ssh/ 执行以下命令,会在当前目录下生成公钥(id_rsa.pub)/私钥(id_rsa)对 第二 ...
- Centos6.5之ssh免密码登录配置
Centos6.5之ssh免密码登录配置 centos ssh 免密码登录 0.说明 这里为了方便说明问题,假设有A和B两台安装了centos6.5的主机.目标是实现A.B两台主机分别能够通过ssh免 ...
- Xshell配置ssh免密码登录-密钥公钥(Public key)与私钥(Private Key)登录【已成功实例】
本文转自https://blog.csdn.net/qjc_501165091/article/details/51278696 ssh登录提供两种认证方式:口令(密码)认证方式和密钥认证方式.其中口 ...
随机推荐
- HTTP请求头信息
常用请求头 User-Agent : 浏览器信息Host : 服务区域名Referer : 通过哪里的链接过来的Origin : 跨域相关Content-Type : POST和PUT请求的数据类型C ...
- EF 常见异常总结
问题:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invoca ...
- 【转】采用dlopen、dlsym、dlclose加载动态链接库
1.前言 为了使程序方便扩展,具备通用性,可以采用插件形式.采用异步事件驱动模型,保证主控制逻辑不变,将各个业务以动态链接库的形式加载进来,这就是所谓的插件.linux提供了加载和处理动态链接库的系统 ...
- 竞赛常用STL备忘录
__builtin: __builtin_popcount:二进制中 1 的个数__builtin_ctz:末尾的 0,即对 lowbit 取log__builtin_clz:开头的 0,用 31 减 ...
- python深浅拷贝与赋值
初学编程的小伙伴都会对于深浅拷贝的用法有些疑问,今天我们就结合python变量存储的特性从内存的角度来谈一谈赋值和深浅拷贝~~~ 预备知识一——python的变量及其存储 在详细的了解python中赋 ...
- PID控制器开发笔记之九:基于前馈补偿的PID控制器的实现
对于一般的时滞系统来说,设定值的变动会产生较大的滞后才能反映在被控变量上,从而产生合理的调节.而前馈控制系统是根据扰动或给定值的变化按补偿原理来工作的控制系统,其特点是当扰动产生后,被控变量还未变化以 ...
- ( linker command failed with exit code 1) 错误解决方案 项目使用的是pod
targets -> build settings -> architectures -> build active architecture only -> debug 改成 ...
- json的转换操作
toJSON 把JS对象{ 'x': 2, 'y': 3 }转为JSON对象格式的字符串 不能转化字符串 比如"{ 'x': 2, 'y': 3 }" 可以转格式不标准的jso ...
- MongoDB----提升
文档之间的联系 一对一:通过文档内嵌的形式体现一对一的关系 db.user.insert({name:"xiaoming",frind:{name:"xiahua&quo ...
- druid配置oracle遇到: 未找到要求的 FROM 关键字 errorCode 923, state 42000
2018年05月29日 16:41:17 阅读数:518 问题背景 项目要连接oracle数据,采用的是durid连接池,但是基本配置下来,运行时发现了这个错误. 方案 可能有的一个错误就是,拼凑sq ...