CentOS 实现自动登陆
1. 在ssh-client一边使用ssh-keygen生成一对rsa key
$ssh-keygen -t rsa
2. 在ssh-client一边使用ssh-add将刚生成的private key加入到ssh agent中(旧配置方式没有这步哟)
$ssh-add ~/.ssh/id_rsa
3. 将上述的public key(id_rsa.pub)的内容附加到ssh-server端的。ssh/authorized_keys中
$cat ~/.ssh/id_rsa.pub | ssh username@ssh-server "cat - 》 authorized_keys"
如果有权限问题,请手动帖.
luojackdeMBP:~ jackluo$ ssh-keygen -t rsa -f ~/.ssh/id_rsa.bt -C "net.webjoy@gmail.com"
luojackdeMBP:~ jackluo$ ssh-add ~/.ssh/id_rsa.bt luojackdeMBP:~ jackluo$ cat ~/.ssh/id_rsa.bt.pub >> ~/.ssh/authorized_keys
luojackdeMBP:~ jackluo$ scp ~/.ssh/authorized_keys root@ip
luojackdeMBP:~ jackluo$ scp ~/.ssh/authorized_keys root@ip:~/.ssh/ luojackdeMBP:~ jackluo$ vim ~/.ssh/config
luojackdeMBP:~ jackluo$ chmod ~/.ssh/config
luojackdeMBP:~ jackluo$ vim ~/.ssh/config
luojackdeMBP:~ jackluo$ chmod ~/.ssh/config ~/.ssh/config:
----------------------------
Host bt 121.40.68.204
IdentityFile ~/.ssh/id_rsa.bt
User root
CentOS 实现自动登陆的更多相关文章
- CentOS下自动登陆root帐户
1 vi /etc/pam.d/gdm 把 auth required …… root quiet这行注释掉 2 vi /etc/pam.d/gdm-passwd 同上 3 vi /etc/gdm/c ...
- 在win10中创建开机自动登陆的网络驱动器
前提环境: win10系统电脑一台. centos系统电脑一台,在该系统中安装samba,并配置共享. 要解决的问题: 在win10做了网络映射,将centos共享的文件夹设置成本地硬盘.在映射时,也 ...
- Linux自动登陆的设置方法
前些天为了实现Linux自动登陆的方法,在网上查了很多资料,发现有不少方法,但网上有些方法的讲解不是特别清楚,或者已经过时.因此,特意整理了一下Linux自动登陆的设置方法.本文的测试环境为Cento ...
- 配置putty自动登陆服务器
putty是一款知名的SSH工具,可以用来登陆linux服务器,提供了终端.SSH是secure Shell的缩写.我之前也有一篇文章介绍这个话题:http://www.cnblogs.com/che ...
- shell实现SSH自动登陆
h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h ...
- 在CentOS下自动备份mysql
在CentOS下自动备份mysql数据库,并差异同步到其它网络主机上 1.在/root/mysql_backup/下添加backup.sh:vim /root/mysql_backup/backup. ...
- curl模拟自动登陆&采集网页数据
<!DOCTYPE> <html> <head> <meta http-equiv="Content-Type" content=&quo ...
- Windows Server 2008 R2怎样设置自动登陆
Windows Server 2008 R2是一款服务器操作系统,提升了虚拟化.系统管理弹性.网络存取方式,以及信息安全等领域的应用,Windows Server 2008 R2也是第一个只提供64位 ...
- Android之记住密码与自动登陆实现
本文主要讲述了利用sharedpreference实现记住密码与自动登陆功能 根据checkbox的状态存储用户名与密码 将结果保存在自定义的application中,成为全局变量 布局文件 < ...
随机推荐
- Hydra---Linux下的暴力美学
引自:http://www.cnblogs.com/mchina/archive/2013/01/01/2840815.html 安装:http://www.91ri.org/2867.html yu ...
- 【转】ByteArrayOutputStream和ByteArrayInputStream详解
ByteArrayOutputStream类是在创建它的实例时,程序内部创建一个byte型别数组的缓冲区,然后利用ByteArrayOutputStream和ByteArrayInputStream的 ...
- iOS 一个工程中引用其他工程时编译的Architecture问题
当引用了其他工程时,在编译时报错,提示你编译指令架构不对,你需要查看一下这几个工程的Architecture部分是否又冲突,比如主工程设置Valid Architecture为armv7 而 另一个子 ...
- Java for LeetCode 151 Reverse Words in a String
Given an input string, reverse the string word by word. For example, Given s = "the sky is blue ...
- mybatisforeach循环,传入多个参数
上代码: controller: @RequestMapping(value = "/findPage", method = RequestMethod.POST) @Respon ...
- MFC RadioButton
添加一组RadioButton 多个radio button,IDC_RADIO1,IDC_RADIO2,IDC_RADIO3 ..将IDC_RADIO1的Group属性选择上,其他不要选Group属 ...
- [Java基础] System.arraycopy使用
转载自:http://blog.csdn.net/java2000_net/article/details/4059465 System提供了一个native 静态方法arraycopy(),我们可以 ...
- 【Python】【解决】UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 1: ordinal not in range(128)
1.问题描述 今天在升级Ubuntu到14.04,使用命令行启动软件更新器,进行版本升级,结果开始升级就异常退出了,具体打印如下: $update-manager -d 正在检查新版 Ubuntu 使 ...
- 【ACM - 搜索模板】
[广搜模板] #include <iostream> #include <stdio.h> #include <string.h> #include <que ...
- PHP 常用正则汇总
平时做网站经常要用正则表达式,下面是一些讲解和例子,仅供大家参考和修改使用: }|d{})-((([-]{}))|([|]))-(([-]([-]{}))|([|]))$/ ([-]{}) ...