ssh 无密码互通
节点n1 n2 n3 互通
第一步:n1->n2互通
admin@n1 > ssh-keygen -d
admin@n1 > scp id_dsa.pub n2:~/.ssh/authorized_keys
这样就实现了 ssh n2 无密码登录
下面的同理:将本机生成的.pub文件追加到对方的authorized_keys文件里面就可以了。
这里出现过一个问题。n1->n2 正常,n2->n1同样的步骤就是不行,admin@n2 > ssh n1 总是需要密码。怎么回事?时间的问题?修改时间同样不行。
最后找出是 .ssh 权限的问题。
Make sure the permissions on the ~/.ssh
directory and its contents are proper. When I first set up my ssh key auth, I didn't have the ~/.ssh
folder properly set up, and it yelled at me.
- Your home directory
~
and your~/.ssh
directory on the remote machine must be writable only by you:rwx------
andrwxr-xr-x
are fine, butrwxrwx---
is no good, even if you are the only user in your group (if you prefer numeric modes:700
or755
, not775
). - Your private key file (on the local machine) must be readable and writable only by you:
rw-------
, i.e.600
. - Your
~/.ssh/authorized_keys
file (on the remote machine) must be readable (at least 400), but you'll need it to be also writable (600) if you will add any more keys to it. - Also, if SELinux is set to enforcing, you may need to run
restorecon -R -v ~/.ssh
(see e.g. Ubuntu bug 965663 and Debian bug #658675; this is patched in CentOS 6).
ssh 无密码互通的更多相关文章
- Linux服务器SSH无密码访问
1.编辑Hosts文件: [root@yqtrack-elk01 /]# vim /etc/hosts
- 普通用户ssh无密码登录设置
这段时间在做Hadoop的环境配置,用root用户只需要按照一定的步骤进行操作就可以直接实现无密码登录,但如果使用新建用户,怎么尝试都不行. 本帖大部分都是其他人帖子的内容.如果按照下面的步骤还是不能 ...
- 烂泥:学习ssh之ssh无密码登陆
本文由秀依林枫提供友情赞助,首发于烂泥行天下 最近一个月没有写过文章,主要是刚刚换的新工作.新公司服务器OS使用的是ubuntu server版,和以前熟悉的centos还是有很多不同的. 刚好这几天 ...
- SSH 无密码远程执行脚本
ssh无密码登录及远程执行脚本要使用公钥与私钥.linux下可以用用ssh-keygen生成公钥/私钥对,下面我以CentOS7为例. 测试环境:机器A(10.0.224.80):机器B(192.16 ...
- CentOS下SSH无密码登录的配置
1.确认本机sshd的配置文件(需要root权限) $ gedit /etc/ssh/sshd_config 找到以下内容,并去掉注释符"#" RSAAuthentication ...
- ssh-keygen+ssh-copy-id 在linux下实现ssh无密码登录访问(转)
转自:http://blog.csdn.net/pennyliang/article/details/8556662 ssh-keygen+ssh-copy-id 在linux下实现ssh无密码登录访 ...
- ssh 无密码登录
ssh 无密码登录要使用公钥与私钥.linux下可以用用ssh-keygen生成公钥/私钥对,下面我以CentOS为例. 有机器A(192.168.1.155),B(192.168.1.181).现想 ...
- CentOS配置ssh无密码登录
CentOS配置ssh无密码登录的注意点 前提配置:使用root登录修改配置文件:/etc/ssh/sshd_config,将其中三行的注释去掉,如下: 然后重启ssh服务:service s ...
- SSH无密码验证
一.安装和启动SSH协议 sudo yum install ssh sudo yum install rsync service sshd restart 启动服务 (rsync是一个远程数据同步工具 ...
随机推荐
- 选课(codevs 1378)
题目描述 Description 学校实行学分制.每门的必修课都有固定的学分,同时还必须获得相应的选修课程学分.学校开设了N(N<300)门的选修课程,每个学生可选课程的数量M是给定的.学生选修 ...
- 2016 Multi-University Training Contest 6 solutions BY UESTC
A Boring Question \[\sum_{0\leq k_{1},k_{2},\cdots k_{m}\leq n}\prod_{1\leq j< m}\binom{k_{j+1}}{ ...
- WebService流行框架CXF
CXF官方网址:http://cxf.apache.org/ CXF官方网址:官网学习地址:http://cxf.apache.org/docs/index.html 官网下载cxf压缩文件: ...
- 最短路——Dijkstra算法
模板 水模板ing #include <cstdio> #include <cstring> #include <algorithm> #include <i ...
- java基础语法4--封装,继承,多态
学习路线: 未封装==>封装==>继承==>多态==>抽象类 首先还是那句话,万物皆对象,对象有行为和属性. 一:封装 1.封装的概念: 信息隐蔽和对象的属性及操作结合成一个独 ...
- google官方建议使用的网站性能测试工具
转自:http://www.laokboke.net/2013/05/12/google-official-recommended-site-performance-testing-tools/ 最近 ...
- 【转载】epoll与select/poll的区别总结
因为这道题目经常被问到.干脆总结一下,免得遗漏了. 参考文章:http://www.cnblogs.com/qiaoconglovelife/p/5735936.html 1 本质上都是同步I/O 三 ...
- Spring4.0MVC学习资料,注解自己主动扫描bean,自己主动注入bean(二)
Spring4.0的新特性我们在上一章已经介绍过了. 包含它对jdk8的支持,Groovy Bean Definition DSL的支持.核心容器功能的改进,Web开发改进.測试框架改进等等.这张我们 ...
- Hive中行列转换
1.演示多列转为单行 数据文件及内容: student.txt xiaoming|english|92.0 xiaoming|chinese|98.0 xiaoming|math|89.5 huahu ...
- Python筛选法(算出十亿之内所有的质数之和)
其实别人写的挺好的了....直接上链接吧http://blog.csdn.net/power721/article/details/8216619