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 ...
随机推荐
- live555 直播arm-linux视频
live555例程testOnDemandRTSPServer.cpp启动一个流服务器 首先启动使用环境, TaskScheduler* scheduler = BasicTaskScheduler: ...
- rocksdb编译测试的正确姿势
需要先安装 gflags 在进行 make db_bench 不然运行 db_bench 会出现 Please install gflags to run rocksdb tools 错误 bench ...
- Floyd 求最短路(poj 1161)
Floyd-Warshall算法介绍: Floyd-Warshall算法的原理是动态规划. 设为从到的只以集合中的节点为中间节点的最短路径的长度. 若最短路径经过点k,则: 若最短路径不经过点k,则. ...
- JS-for中的i
var aBtn = document.getElementsByTagName('input'); for( var i=0; i<aBtn.length; i++ ){ ...
- JS-怎么得到局部域中的数据
1,使用全局变量 var str = '';function fn1(){ var a = '大鸡腿~'; str = a;} 2,使用一个局部函数 function fn2(){ ...
- fgets和fputs函数
1 函数输入 下面两个函数提供每次输入一行的功能. #include <stdio.h> char *fgets( char *restrict buf, int n, FILE *res ...
- PHP注册手机获取验证码代码
php代码: <?php require dirname(__FILE__).'/include/common.inc.php';//这是在cms2008下面做的测试 header(" ...
- 20145301&20145321&20145335实验一
这次实验我的组员为:20145301赵嘉鑫.20145321曾子誉.20145335郝昊 实验内容详见:实验一报告
- Block 传值
A 界面: - (IBAction)gotoVC:(id)sender { //必须在事件发生时调用Block,每次Block对应一次初始化 cvc = [[CViewController alloc ...
- 配置SQL Server去使用 Windows的 Large-Page/Huge-Page allocations
配置SQL Server去使用 Windows的 Large-Page/Huge-Page allocations 目录表->页表->物理内存页 看这篇文章之前可以先看一下下面这篇文章 ...