Passwordless SSH Login
原文地址:http://manjeetdahiya.com/2011/03/03/passwordless-ssh-login/
Consider two machines A and B. We want to connect machine B from A over SSH. To do so we have to specify password every time we connect. Here, we can create a setup where SSHing can be done without the password prompt. On connecting machine B from A, ssh won’t ask for password.
Overview of Setup
- Generate public and private encryption keys on machine A.
- Authorize machine A in machine B by appending the public key of A in the file authorized_keysof machine B.
That’s it! You can now access (SSH) machine B from A without specifying the password. B has been now authorized to access A without requiring the password.
Detailed Steps
Method 1
- Login to machine A and execute the following command:
1
ssh-keygen &&ssh-copy-id-i user@BThe first command generates keys. It will ask for path of the keys and passphrase. Hit Enter key repeatedly to choose the default values.
The second command adds generated key to B. It will ask for password of user at machine B. And this would be the last time!
Method 2
- Login to machine A.
- Generate public and private keys like following:
1
ssh-keygen -t dsaIt will ask for path of the keys and passphrase. Choose the default path and no password.
This will generate files id_dsa.pub and id_dsa in ~/.ssh - Browse for the above generated keys and copy the public key, that is id_dsa.pub, to the machine B.
- Login to machine B.
- Append the public key of A to the file authorized_keys:
1
catid_dsa.pub >> .ssh/authorized_keysNote: Create the directory .ssh in your home if it doesn’t exist.
You can now delete id_dsa.pub from machine B if you want to. - Make sure of the permissions of the directory .ssh and the file authorized_keys are read-write only by the targetted user. Otherwise it might not work.
12
chmod700 .sshchmod600 .ssh/authorized_keys - Now go back to machine A and SSH machine B. It should not ask for the password.
Passwordless SSH Login的更多相关文章
- Oracle 11g RAC INS-06006 Passwordless SSH connectivity not set up between the following node(s)
安装11g RAC的grid时,在Test互信的时候报错INS-06006 Passwordless SSH connectivity not set up between the following ...
- Fixing ssh login long delay
原文:http://injustfiveminutes.com/2013/03/13/fixing-ssh-login-long-delay/ For a long time I had a prob ...
- [INS-06006] Passwordless SSH connectivity not set up between the following node(s)
解决方法1 参考:11.2.0.4 runInstaller: [INS-06006] Passwordless SSH connectivity not set up between the fol ...
- SSH login without password
SSH login without password Your aim You want to use Linux and OpenSSH to automize your tasks. Theref ...
- Security configuration of SSH login entry - enterprise security practice
catalog . 引言 . 修改ssh端口 . 禁用root远程ssh登录 . 只使用SSH v2 . 限制用户的SSH访问 . 禁用.rhosts文件 . 禁用基于主机的身份验证 . 基于公私钥的 ...
- ssh login nova vm
$ sudo cat >> /usr/bin/nova-ssh << END FIRST=$1 IDX=`expr index $1 "@"`if [[ ...
- 3 Steps to Perform SSH Login Without Password Using ssh-keygen & ssh-copy-id
http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-s ...
- 【转载】SSH login without password 免密登陆
Your aim You want to use Linux and OpenSSH to automate your tasks. Therefore you need an automatic l ...
- putty ssh login linux
(1) in linux $ ssh-keygen -t dsa $ cd .ssh $ cat id_dsa.pub > authorized_keys $ chmod 600 authori ...
随机推荐
- three.js 相关概念
1.什么是three.js? Three.js 是一个 3D JavaScript 库.Three.js 封装了底层的图形接口,使得程序员能够在无需掌握繁冗的图形学知识的情况下,也能用简单的代码实现三 ...
- UIColor 分类 16进制转 RGB
.h #import <UIKit/UIKit.h> @interface UIColor (WJ) + (UIColor *)colorWithWJString:(NSString *) ...
- Jungle Roads
Description The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid ...
- python基础语法(4)
十.Python标准库 Python标准库是随Pthon附带安装的,包含了大量极其有用的模块. 1. sys模块 sys模块包含系统对应的功能 sys.argv ---包含命令行参数,第一个参数是py ...
- MySQL使用小记
时间格式化: select date_format('2008-08-08 22:23:01', '%Y%m%d%H%i%s'); 去重复: use iksdb3; select distinct ` ...
- php 和mysql httpd 简单网页的搭建
使用两台服务器 Centos 7 做 php和httpd和php-sql 服务的安装 CentOS 5 做php 和 mysql 的安装 1.搭建本地yum源 两台服务器 都是 2.关闭防火墙和s ...
- CentOS6.5下Tomcat7 Nginx Redis配置步骤
所有配置均在一台机器上完成,部署拓扑信息如下: 注意:由于Redis配置对jar包和tomcat版本比较严格,请务必使用tomcat7和本文中提供的jar包.下载地址: http://pan.baid ...
- 【Python自动化运维之路Day6】
1.递归思考题,阶乘 使用递归方式(函数)计算: 1*2*3*4*5*6*7*8*9*10的值 def func(num): if num==1: return 1 return num*func(n ...
- UML类图基本元素符号
UML类图基本元素符号 元素名称 符号图例 含义 Class 包含类的名称.属性和方法定义. 可见性修饰符: + public - private # protected 无修饰符为 intern ...
- HTTP权威指南阅读笔记一:HTTP概述
HTTP协议版本: 1.HTTP/0.9:HTTP的1991原型版本称为HTTP/0.9.这个协议有很多严重的缺陷,只应该用与与老客户端的交互.HTTP/0.9只支持GET方法,不支持多媒体内容的MI ...