rsync和ssh使用方法
来源:互联网 发布:淘宝客服在哪里找 编辑:程序博客网 时间:2024/06/06 18:21
rsync同步或ssh ip时需要输入服务器密码,可以通过如下操作实现无密码安全操作。
1.产生公匙文件,注意不要输入passphrase
[wm@adx .ssh]$ ssh-keygen -t dsaGenerating public/private dsa key pair.Enter file in which to save the key (/home/wm/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/wm/.ssh/id_dsa.Your public key has been saved in /home/wm/.ssh/id_dsa.pub.The key fingerprint is:9b:fc:6f:fc:7f:4b:22:8f:9f:db:91:ef:3f:39:b0:6f wm@adx[wm@adx .ssh]$ ls -altotal 28drwx------ 2 wm wm 4096 Oct 22 10:15 .drwxrwx--- 9 wm wm 4096 Oct 22 10:01 ..-rw------- 1 wm wm 668 Oct 22 10:15 id_dsa-rw-r--r-- 1 wm wm 596 Oct 22 10:15 id_dsa.pub-rw------- 1 wm wm 1671 Sep 28 19:01 id_rsa-rw-r--r-- 1 wm wm 388 Sep 28 19:01 id_rsa.pub-rw-r--r-- 1 wm wm 1211 Oct 21 18:09 known_hosts
-t type
指定要创建的密钥类型。可以使用:"rsa1"(SSH-1) "rsa"(SSH-2) "dsa"(SSH-2)。
提示创建.ssh/id_rsa、id_rsa.pub的文件,其中第一个为密钥,第二个为公钥。
2.将公钥文件传送到需要登陆的服务器
[root@adx ~/.ssh]# scp id_rsa.pub root@192.168.1.25:/data/
[root@adx ~/.ssh]# ssh 192.168.1.25Last login: Wed Oct 22 08:33:44 2014 from 192.168.1.151
4.将刚才的公钥文件内容添加到用户的.ssh目录下的authorized_keys文件中
[root@tadx data]# cat id_rsa.pub >> /root/.ssh/authorized_keys
5.退出后再次登录,不需要密码。
0 0
- rsync和ssh使用方法
- scp和rsync--ssh文件传输
- rsync 使用方法
- rsync+ssh
- ssh rsync
- rsync 配置方式 和 ssh 认证原理
- rsync工具介绍、rsync常用选项和rsync通过ssh同步
- rsync使用方法总结
- rsync+ssh配置详解
- Rsync+ssh同步服务器
- rsync、ssh备份
- Rsync+ssh双机备份
- ssh与rsync简介
- linux配置ssh+rsync
- SSH,rsync,inotifywait
- linux配置ssh+rsync
- rsync+ssh同步备份文件
- rsync + ssh的使用
- sharesdk有遮罩层
- Tomcat6源码解析--Bootstrap.java
- osgearth各个例子功能概述
- DVB机顶盒工作原理
- Shell脚本入门(十一) - 子程序
- rsync和ssh使用方法
- Java容器分析--List和Set
- C++中cin、cin.get()、cin.getline()、getline()、gets()函数的用法
- 为iPhone 6设计自适应布局
- 一位ACMer过来人的心得
- android NDK开发编译C++文件出现Type 'jint' could not be resolved和Unresolved inclusion: <jni.h>的解决办法
- MINA框架学习 (一)
- 再次普及一下启Tomcat报错的问题定位方案
- 菜鸟学习RTSP所需要的基本知识