在linux下使用远程拷贝命令scp时会出现密码提示
来源:互联网 发布:java调用tomcat 编辑:程序博客网 时间:2024/06/02 04:32
把你的本地主机用户的ssh公匙文件写入到远程主机用户的~/.ssh/authorized_keys文件中,具体方法
假设本地主机test1,远程主机test2
一,在test1主机里的用户
运行 ssh-keygen -t rsa
结果如下
Generating public/private rsa key pair.
Enter file in which to save the key (/home/.username/ssh/id_rsa):#回车
Enter passphrase (empty for no passphrase):#回车
Enter same passphrase again:#回车
Your identification has been saved in /home/.username /.ssh/id_rsa.
Your public key has been saved in /home/.username /.ssh/id_rsa.pub.
The key fingerprint is:
38:25:c1:4d:5d:d3:89:bb:46:67:bf:52:af:c3:17:0c username@localhost
Generating RSA keys:
Key generation complete.
会在用户目录~/.ssh/产生两个文件,id_rsa,id_rsa.pub
二,把id_rsa.pub文件拷贝到test2主机的用户目录下
cat id_rsa.pub >~/.ssh/authorized_keys
就可以了
这样test1主机的用户就可以通过ssh而不用密码登陆test2主机
假设本地主机test1,远程主机test2
一,在test1主机里的用户
运行 ssh-keygen -t rsa
结果如下
Generating public/private rsa key pair.
Enter file in which to save the key (/home/.username/ssh/id_rsa):#回车
Enter passphrase (empty for no passphrase):#回车
Enter same passphrase again:#回车
Your identification has been saved in /home/.username /.ssh/id_rsa.
Your public key has been saved in /home/.username /.ssh/id_rsa.pub.
The key fingerprint is:
38:25:c1:4d:5d:d3:89:bb:46:67:bf:52:af:c3:17:0c username@localhost
Generating RSA keys:
Key generation complete.
会在用户目录~/.ssh/产生两个文件,id_rsa,id_rsa.pub
二,把id_rsa.pub文件拷贝到test2主机的用户目录下
cat id_rsa.pub >~/.ssh/authorized_keys
就可以了
这样test1主机的用户就可以通过ssh而不用密码登陆test2主机
- 在linux下使用远程拷贝命令scp时会出现密码提示
- Linux下使用scp命令进行自动远程拷贝
- linux下的远程拷贝命令scp
- 在Linux下远程使用scp拷贝文件
- 在Linux下远程使用scp拷贝文件
- Linux 使用scp命令远程拷贝文件
- Linux 远程拷贝命令 scp
- linux下scp命令(远程文件拷贝)详解
- Linux文件远程拷贝命令scp的使用
- 解决Linux下Scp命令免密码远程复制
- Linux scp 远程数据拷贝 命令
- linux命令之cp/scp 远程拷贝
- scp远程拷贝命令的使用
- 远程拷贝命令scp
- SCP 远程拷贝命令
- Linux SCP 远程拷贝
- Linux scp 远程拷贝
- linux scp 远程拷贝
- 如何理解父类引用指向子类对象
- 怎么获得hql的查询的count(*)
- hdu - 4705 - Y(树型dp)
- Eclipse快捷键 10个最有用的快捷键
- XML序列化与反序列化
- 在linux下使用远程拷贝命令scp时会出现密码提示
- 关于等级struts2 ver 2.3.15.1时的注意事项
- GDAL for Android在linux下交叉编译的问题
- AOP helloworld by XML
- python解析xml之lxml
- c++ primer习题9.26
- uploadify上传插件使用(一)
- php 高级 自定义 变量调节器(不错的玩意)
- iOS程序开发引用的第三方库之间出现duplicate symbol时的处理方法