在线辅导课非常多,但仍录,使用时方便日后查询。

两server,内联网ip每间:

172.16.3.91 (本地计算机)

172.16.3.92 (远程机)

现在想在本地计算机上通过ssh 172.16.3.92到远程机而不须要password。

1.在本地机上用ssh-keygen 创建公钥私钥。

[root@rs-1 ~]# 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:

dc:fc:ea:b8:bb:74:d7:75:4b:6a:27:82:28:27:be:d6 root@rs-1

这个过程会提示输入password,记住直接按回车即可。不要输入password!要是输入了password,一会訪问的时候就须要输入password了。

创建之后能看到例如以下两个文件

[root@rs-1 .ssh]# ll

total 24

-rw------- 1 root root 1675 May  8 07:18 id_rsa

-rw-r--r-- 1 root root  391 May  8 07:18 id_rsa.pub

id_rsa是私钥

id_rsa.pub是公钥。 主要给远程机使用的

2.把公钥传到远程机上去。

[root@rs-1 .ssh]# scp id_rsa.pub root@172.16.3.92:~/.ssh/authorized_keys

Address 172.16.3.92 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!

root@172.16.3.92's password:

id_rsa.pub                                                                                                                                  100%  391     0.4KB/s   00:00

3.ssh链接时候就不须要password了,直接登陆到远程机

[root@rs-1 .ssh]# ssh 172.16.3.92

Address 172.16.3.92 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!

Last login: Thu May  8 07:19:28 2014 from 172.16.3.91

[root@rs-2 ~]#

參考:http://blog.csdn.net/gongqingkui/article/details/9023439

版权声明:本文博主原创文章,博客,未经同意不得转载。

ssh否password登陆server的更多相关文章

  1. 正式生产环境下hadoop集群的DNS+NFS+ssh免password登陆配置

    博客地址:http://www.loveweir.com/ 环境虚拟机centos6.5 主机名h1  IP 192.168.137.11  作为DNS FNS的server 主机名h2  IP 19 ...

  2. Hadoop之——CentOS构造ssh否password登录注意事项

    转载请注明出处:http://blog.csdn.net/l1028386804/article/details/46388809 前提配置:使用root登录改动配置文件:/etc/ssh/sshd_ ...

  3. Linux 批量建立信任关系,实现ssh无password登陆的脚本

    作用: 把当前机器的ssh公钥拷贝到其它机器.以实现从当前机器能够ssh无password登陆到其它机器 用法: 1)把要加入的ip地址写入到一个文件里.比方host 2)把脚本保存为sh文件,如 i ...

  4. 公钥\私人 ssh避password登陆

    相关概念以前见过,决不要注意,使用公共密钥管理之前,腾讯云主机的备案机,非常头发的感觉,查了一下相关资料,这里总结下: 字符a:192.168.7.188 (ubuntu) 字符b:192.168.7 ...

  5. SSH无password登陆配置

    摘录一 在192.168.42.142机器上 1)执行:ssh-keygen -t rsa 2)然后拍两下回车(均选择默认) 3)执行: ssh-copy-id -i /root/.ssh/id_rs ...

  6. Linux学习笔记--SSH免password登录

    须要实现的效果: 有两台server:"192.168.201.236" 和 "192.168.201.237" 须要实现:在server"192.1 ...

  7. Linux而不必进入password登陆自己主动sshserver方法

    使用OpenSSH在linux通过登陆sshserver时间,系统会提示您输入每次password,和用途vim 的netrw保存编辑后的每一个变化必须失去远程文件时,插件password,很多麻烦. ...

  8. ubuntu系统使用SSH免密码登陆

    ubuntu系统使用SSH免密码登陆 | 浏览:5160 | 更新:2014-02-13 19:15 1 2 3 4 5 6 7 分步阅读 百度经验:jingyan.baidu.com 我们通常使用U ...

  9. ssh的配置,ssh打开密钥登陆,关闭密码登陆。

    刚装玩fedora,那么我们就以fedora为例来说一下怎么配置: 1.先确认是否已安装ssh服务: [root@localhost ~]# rpm -qa | grep openssh-server ...

随机推荐

  1. [Android学习笔记]Android Library Project的使用

    RT http://developer.android.com/tools/projects/index.html

  2. Android中九种dialog对话框代码

    public class MainActivity extends Activity { private static final int MAX_PROGRESS = 100; private st ...

  3. TR90眼镜_百度百科

    TR90眼镜_百度百科 TR90眼镜

  4. acdream 1222 Quantization Problem [dp]

    称号:acdream 1222 Quantization Problem 题意:给出一个序列 a ,然后给出一个 n * m 的矩阵,让你从这个矩阵中选出一个序列k,使得sum(abs(ki - ai ...

  5. Terracotta收购Ehcache (转)

    随着Terracotta对Ehcache的收购成行,业界两大知名的开源Java缓存产品走到了一起.以提供JVM级“POJO集群”而闻名于世的Terracotta可以将运行在单个JVM上的多线程应用移植 ...

  6. java socket 的参数选项解读(转)

    java socket中有很多参数可以选择,这篇博客的目的是沉淀出这些参数的语义和用法,供自己以后查阅. 1.java socket参数选项总览 在JDK1.6中有如下参数选项: 1 public f ...

  7. LNK1207: incompatible PDB format in********

    LNK1207: incompatible PDB format in******** VC中错误:LINK : fatal error LNK1207: incompatible PDB forma ...

  8. thinkphp框架相关研究(一)

    小编最近开始正式研究thinkphp框架,在此写下研究的整个历程,从最最基本的搭建网站开始,一步步记录.希望对大家有所帮助. 1.菜鸟从下载框架到建站 参考网址:http://blog.csdn.ne ...

  9. gustafson,Sun-Ni,Amdahl

    gustafson 定律由 John Gustafson首先提出.描述:系统优化某部件所获得的系统性能的改善程度,取决于该部件被使用的频率,或所占总执行时间的比例. Gustafson定理中,加速比与 ...

  10. Context Switch and System Call

    How many Context Switches is “normal”? This depends very much on the type of application you run. If ...