SUMMARY:
two server : A , B
source server : A
destination server : B
the steps of migrate data from A to B without password.
(1) generate A public key.
(2) copy A's public key to B.
(3) login A remote B without password to copy file. // NOTES : if want to login B to remote A , need to install B's public key to A.

DETAIL:
1、login source server 'A' with root create usergroup and user which user have not password.

//create usergroup
# groupadd goodmood
//create user
# useradd -d /home/goodmooduser -m -g goodmood goodmooduser
//give user and usergroup to directory and recursive.
# chown -R goodmooduser:goodmood /home/goodmooduser

2、login destination server 'B', do same step as step1.

3、login source server 'A', generate public key.

# cd /opt/SSHtectia/util/
# ls
# ./generate_keys goodmooduser
# cd /etc/opt/SSHtectia/keys/goodmooduse
# cat id_rsa_2048_a.pub

4、login destination server 'B', do same step as step3.

5、install the public key of source server 'A' to destination server 'B'

# cd /etc/opt/SSHtectia/keys
# ls
# cd goodmooduser
# vi goodmooduser@A.pub // parse 'A' public key
# vi authorization //add below script to this file.
Key goodmooduser@A.pub
Options command="eval $SSH_ORIGINAL_COMMAND",allow-from="A.nam.nsroot.net"

6、login source server 'A' with root, then execute below steps without password, copy file or directory from source server /Adirectory to destination server /Bdirectory

su - goodmooduser
sftp goodmooduser@B.nam.nsroot.net
put /Adirectory /Bdirectory
exit

Linux - SSH - Password-less login - generate public key - migrate data without password between two VM servers的更多相关文章

  1. Linux SSH登录服务器报ECDSA host key "ip地址" for has changed and you have requested strict checking.错误

    Linux SSH命令用了那么久,第一次遇到这样的错误:ECDSA host key "ip地址" for  has changed and you have requested ...

  2. 生成ssh公有密钥而且注冊到Github Generate ssh rsa keys and register public key on Github

    私有密钥和公有密钥是成对的两个文件,私有文件保存在自己的本机,公有密钥保存到还有一端的server,站点等. github就是一种站点. 仅仅有保存了私有密钥的机器才干訪问远程的server等. 使用 ...

  3. Linux SSH登录服务器报ECDSA host key "ip地址" for has changed and you have requested strict checking错误

    错误:ECDSA host key "ip地址" for  has changed and you have requested strict checking. 解决方案:在终端 ...

  4. Linux使用Public Key方式远程登录

    一.前言: ssh远程登录密码认证的方式有三种,password.Keyboard Interactive.Public Key 前面两种方式就是密码认证,含义都是一样大同小异.第三种是登录方式最安全 ...

  5. linux ssh publickey登录

    一.公钥认证的基本思想: 对信息的加密和解密采用不同的key,这对key分别称作private key和public key,其中,public key存放在目标服务器上,而private key为特 ...

  6. windows,linux,mac生成ssh public key 和 private key

    https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair Creating the key How you create your SSH ...

  7. linux ssh 使用深度解析(key登录详解)

    SSH全称Secure SHell,顾名思义就是非常安全的shell的意思,SSH协议是IETF(Internet Engineering Task Force)的Network Working Gr ...

  8. linux ssh使用深度解析(key登录详解)

    linux ssh使用深度解析(key登录详解) SSH全称Secure SHell,顾名思义就是非常安全的shell的意思,SSH协议是IETF(Internet Engineering Task ...

  9. Linux SSH: key, agent, keychain

    以前遇到过一个问题,在用有些 Linux 发行版时,用 ssh-keygen 产生好了密钥对并上传到了目标服务器,但每次登录都要重新输入. 这与 ssh-agent 有关,看如下 man ssh-ag ...

随机推荐

  1. css 设置字体

    CSS,font-family,好看常用的中文字体 例1(小米米官网):font-family: "Arial","Microsoft YaHei"," ...

  2. IOS多线程 总结 -------------核心代码(GCD)

    //NSObject //在子线程中执行代码 // 参数1: 执行的方法 (最多有一个参数,没有返回值) //参数2: 传递给方法的参数 [self performSelectorInBackgrou ...

  3. CPU卡中T=0通讯协议的分析与实现

    IC卡的应用越来越广泛,从存储卡到逻辑加密卡,目前CPU卡已经逐渐在应用中占据主导地位.CPU卡根据通讯协议可分为两种:接触式和非接触式.接触式CPU卡主要采用两种通讯协议:T=0和T=1通讯协议.T ...

  4. android 让图片充满整个屏幕

    方法1: <ImageView android:id="@+id/imageView1" android:layout_width="fill_parent&quo ...

  5. URAL 2038 Minimum Vertex Cover

    2038. Minimum Vertex Cover Time limit: 1.0 secondMemory limit: 64 MB A vertex cover of a graph is a ...

  6. Java 8 新特性终极版

    声明:本文翻译自Java 8 Features Tutorial – The ULTIMATE Guide,翻译过程中发现并发编程网已经有同学翻译过了:Java 8 特性 – 终极手册,我还是坚持自己 ...

  7. 弹出框layer的使用封装

    layer弹出框官方网址:http://layer.layui.com/ layer常用方法的封装:layerTool.jsp layer.config({ extend: 'extend/layer ...

  8. table表格边框样式

    ; border-left:1px solid #aaa; border-top:1px solid #aaa; } td{border-right:1px solid #aaa; border-bo ...

  9. 让你不再纠结GitHub:Git起步

    一.关于版本控制 版本控制是一种记录若干文件内容变化,以便将来查阅特定版本修订情况的系统.我们通常仅对保存着软件源代码的文本文件做版本控制,但实际上,你可以对任何类型的文件进行版本控制. 采用版本控制 ...

  10. UICollectionView的基本使用

    这个控件,看起来与UITableView有点像,而且基本的用法也很相像哦!!! 我们来看看API: #pragma mark - UICollectionViewDataSource // 指定Sec ...