使用 scp命令免登陆
来源:互联网 发布:htc刷机救砖软件 编辑:程序博客网 时间:2024/05/17 05:03
多台服务器之间互相拷贝文件一般常用scp命令但是让人困扰的是还要输入密码,
能不能不输入密码直接拷贝?
所幸方法是有的,ssh服务是支持免登陆的,不过需要密钥文件
方法如下:
[root@WebServer3 ~]# ssh-keygen -t rsaGenerating 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:
a2:1d:43:32:26:06:68:48:d5:62:16:6d:a2:c7:53:8c root@WebServer3
输入命令后直接都按回车就行。
第一提示是密钥保存位置
Enter file in which to save the key (/root/.ssh/id_rsa):
直接回车保存到默认地方 /root/.ssh/id_rsa
第二个提示是输入一个不同于你的password的密码。直接按回车,不输入密码,保持密码为空。
其中公共密钥保存在 ~/.ssh/id_rsa.pub
私有密钥保存在 ~/.ssh/id_rsa
拷贝密钥文件到目标服务器
[root@WebServer3 ~]#scp ~/.ssh/id_rsa.pub 192.168.0.23:/root/.ssh/authorized_keys
配置完毕,你在这台机器上用scp ssh sftp 命令访问目标机器的时候就不用输入密码了
参考文档:http://www.chinaunix.net/old_jh/4/343905.html
0 0
- 使用 scp命令免登陆
- ssh互信(免密码使用scp命令)
- Shell实例:ssh, scp 免密码登陆
- SSH传输scp免密码登陆的方法
- scp时使用expect免密码交互
- SCP 命令的使用
- scp命令使用
- scp 命令使用
- scp命令使用实例
- scp命令的使用
- cp scp命令使用
- SCP命令使用:文件传输
- Linux scp命令使用
- scp命令使用
- scp命令的使用
- scp命令使用
- scp命令的使用
- scp 命令的使用
- 黑马程序员————IOS学习笔记 第11篇 经典示例计算代码行数
- Feekood开发环境介绍(2)-- 资源管理界面
- linux shell 远程执行命令
- CodeForces 148E Porcelain
- 1600 - Patrol Robot
- 使用 scp命令免登陆
- github上好用的第三方库
- ubuntu下安装lamp环境
- HTML Attributes
- 10410 - Tree Reconstruction
- 将文字转换为拼音
- CentOS 安装 openoffice 和swftools 编译安装
- kindEditor 乱码解决
- hibernate 核心类讲解2(第二天)