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. 【Android纳米学位】project 0 - 问题汇总

    1.页面布局 参考:http://www.xuebuyuan.com/1100763.html 从不知道如何下手到开始布局出想要的样子,使用线性布局及属性 margin,padding 2.添加点击事 ...

  2. JAVA回调函数ANDROID中典型的回调地方

    在计算机中回调函数是指通过函数参数传递到其他代码类的,某一块可执行代码的引用,这以设计允许了底层代码调用者在高层定义的子程序. 在JAVA里面我们使用接口的方式来实现函数的回调. 回调的通俗就是:程序 ...

  3. [每日一题JS] 正则表达式

    判断字符串是否是这样组成的,第一个必须是字母,后面可以是字母.数字.下划线,总长度为5-20 var reg = /\b[a-zA-Z]{1}[a-zA-Z0-9_]{4,19}\b/; var fl ...

  4. Codeforces 429B Working out

    http://codeforces.com/contest/429/problem/B 题意:一个从左下到右上,一个从左上到右下,要求只相交一次,求整个路径和的最大值 思路:发现可以枚举交点,然后算到 ...

  5. Fiddler 的几个用法

    原文地址:http://wenku.baidu.com/link?url=VGYtzCpGdWzyvGFAIgCVS_KbSh5Oemd4rRYqyJORDchy4jxtEiRNWbp0tqPtlBR ...

  6. CentOS6.5下安装wine

    系统信息: Centos 6.5 i386 GUN/Linux 1. 首先安装一个epel rpm -ivh http://mirrors.yun-idc.com/epel/6/i386/epel-r ...

  7. Js获取元素样式值(getComputedStyle&currentStyle)兼容性解决方案

    因为:style(document.getElementById(id).style.XXX)只能获取元素的内联样式,内部样式和外部样式使用style是获取不到的. 一般js获取内部样式和外部样式使用 ...

  8. Spring redirect直接返回项目根文件夹

    return "redirect:/";

  9. [RxJS] Resubscribing to a Stream with Repeat

    When you complete a stream, there’s no way to restart it, you must resubscribe. This lesson shows ho ...

  10. Android ActionBar详解(三):ActionBar实现切换Tabs标签

    实现切换Tabs标签; Activity代码: public class ActionBarTabs extends Activity { @Override protected void onCre ...