数据库

批量管理自动化运维100台小规模服务器

时间:2010-12-5 17:23:32  作者:应用开发   来源:数据库  查看:  评论:0
内容摘要:复制[root@centos7~]#ssh-keygen-trsa-f.ssh/id_rsa#生成秘钥对 Generatingpublic/privatersakeypair.

批量管理自动化运维100台小规模服务器
复制[root@centos7  ~]#ssh-keygen -t rsa -f .ssh/id_rsa                  #生成秘钥对   Generating public/private rsa key pair.   Enter passphrase (empty forno passphrase):        #如若选择给私钥加口令,批量则在每次使用时,管理提供口令  Enter same  passphrase again:                                   时,自动在使用时需输入口令,化运如不输入口令时,IT技术网维台务器需保护好   Your identification has been saved in .ssh/id_rsa.口令,小规一旦丢失相当于***钥匙。模服   Your publickey has been saved in .ssh/id_rsa.pub.   The key fingerprint is:   37:18:3a:18:f7:43:f1:b0:59:5a:75:88:29:bf:ac:5d root@centos7.location.com  [root@centos7  ~]#ls .ssh/                #验证生成的批量密钥对   id_rsa   id_rsa.pub   known_hosts    [root@centos7 ~]#ssh-copy-id -i .ssh/id_rsa.pub root@192.168.100.128  #将密钥上传到免登陆服务器,源码库                                                                                                               自动加载到/root/.ssh目录  ####################################################################################################  [root@centos6 ~]#  ifconfig eth0   eth0    Link encap:Ethernet   HWaddr 00:0C:29:AD:7B:C1                inet addr:192.168.100.128   Bcast:192.168.100.255   Mask:255.255.255.0  [root@centos6 ~]#  ls .ssh/     #验证发现通过ssh-copy-id上传,管理自动将key定义为authorized.keys   authorized_keys   known_hosts   #上传到服务器的自动公钥自动更名的依据可查看/etc/ssh/ssh_config  ################################此时完成免密码登录认证##############################################   1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.服务器托管
copyright © 2025 powered by 编程之道  滇ICP备2023006006号-34sitemap