现在要添加ssh的认证密钥免去每次ssh登录服务器要输入用户名和密码
<!--
@page { size: 21.59cm 27.94cm; margin: 2cm }
P { margin-bottom: 0.21cm }
-->
第一步:生成密匙对,我用的是
rsa的密钥。使用命令
"ssh-keygen -t rsa"
第二步:把生成的密钥传到你要登录的服务器的 /root/.ssh/authorized_keys
scp /root/.ssh/id_rsa.pub root@134.161.1.158:/root/.ssh/authorized_keys
这样你下次登录对方服务器就可以不需要用户名和密码
下面我们就来讲讲同时对多个服务器进行操作,比如我服务器A上有一个文件包,要传到其他的14个地市服务器
因为现在SSH不需要用户名和密码就可以这样实现
for host in host1 host2 host3 ...
do
scp <filelist> "$host:/path/to/destination"
done
for host in 134.165 134.167.4 34.1638 1364.80 1 134.4.180 3.6.131.71 10.1.200 13.72 134.16 17.34 13
436 13.1. ;
do
scp /opt/wifioss/node.tgz root@$host:/opt/wifioss/node.tgz;
done
统一升级地市采集: MY SOLUTION
第一:生成上述
rsa的密钥对,并scp到地市的/root/.ssh/authorized_keys中
第二:在/etc/hosts中添加对应各地市名陈的host与名陈对应
122.2.2.2 changde
122.3.3.3 zhuzhou
122.4.4.4 changsha
……
第三:通过循环完成对各个地市的采集补丁升级
for host in changde changsha chenzhou hengyang huaihua jishou loudi shaoyang xiangtan yiyang yongzhou yueyang zhuzhou; do ssh $host 'cd /opt/wifioss/node;tar xvf patch0928.tgz;make'; done
地市A日志:src/monet/monet_util.erl
(cd src;make)
make[1]: Entering directory `/opt/wifioss/node/src'
(cd core;make)
make[2]: Entering directory `/opt/wifioss/node/src/core'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/opt/wifioss/node/src/core'
(cd cron;make)
……
地市B日志:
src/monet/monet_util.erl
(cd src;make)
make[1]: Entering directory `/opt/wifioss/node/src'
(cd core;make)
make[2]: Entering directory `/opt/wifioss/node/src/core'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/opt/wifioss/node/src/core'
(cd cron;make)
make[2]: Entering directory `/opt/wifioss/node/src/cron'
……
……
这样就完成了对14个地市采集补丁的统一升级
分享到:
相关推荐
Arduino Webserver with Authentication Sketch
Juniper Image Authentication Key 新版证书(包含旧版)
ssh2 一些错误问题的记录
rfc4252 The Secure Shell SSH Authentication Protocol pdf rfc4253 The Secure Shell SSH Transport Layer Protocol pdf rfc4254 The Secure Shell SSH Connection Protocol pdf">本资源包含了SSH协议相关的主要...
How to use SFTP (with client validation - public key authentication) The topic How to use SFTP (with client validation - password authentication) discusses the simplest form of client ...
Passwordless Authentication With Golang
一、ssh服务器安装 1).我们使用免费软件freeSSHd。... 2)安装完成后进入配置界面, (1)Server State中确保SSH服务已打开 ...(3)在Authentication界面,确定Public key为Allowed. (4)在Linux客户端ssh配置,参
Quantum Authentication of Classical Messages with Perfect SecurityQuantum Authentication of Classical Messages with Perfect SecurityQuantum Authentication of Classical Messages with Perfect Security
Kubernetes RBAC with Openssl Authentication 介绍k8s的认证授权机制
remote user authentication scheme with forward secrecy, which provides forward secrecy to the long term secret key of the authentication server. This scheme is also secure against Chan – Cheng and ...
An improved remote user authentication scheme with key agreement
A Novel RFID Authentication Protocol with Ownership Transfer Han Jia1, Jun Wen2 School of Computer Science and Technology, University of Electronic Science and Technology of China,Chengdu, China 1...
Multi-user quantum key distribution with mutual authentication
Quantum authentication of classical messagesQuantum authentication of classical messagesQuantum authentication of classical messages
SecureCRT keygen
主要给大家介绍了关于MySQL连接抛出Authentication Failed错误的分析与解决方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
一种无线传感器网络中的联合纠错与节点自定位算法,罗君,石春,无线传感器网络中的节点在自定位时,所用到的距离信息通常会受到大的测量错误的干扰,如果将错误的距离信息用于定位,将会导致错误的
基于四粒子簇态的带认证的受控量子安全直接通信,赵喆子健,陈秀波,本文提出了新的基于四粒子簇态带认证的受控量子安全直接通信协议。通信双方通过事先共享的身份串来验证对方的身份以防止窃听者伪
FormsAuthentication 权限验证
Authentication protocols are the basis of security in many distributed systems, and it is therefore essential to ensure that these protocols function correctly. Unfortunately, their design has been ...