SQL Server 2019 for Linux – ssh-keygen

1、修改计算机名字

服务器名称IP地址描述系统
SQLAG01192.168.31.203节点1Centos 7
SQLAG02192.168.31.204节点2Centos 7
SQLAG03192.168.31.205节点3Centos 7
SQLAG192.168.31.206SQL监听器Centos 7
SSMS192.168.31.9SQL Server
Management Studio
WinSRV
主机信息
hostnamectl set-hostname sqlag01

2、修改etc/hosts记录

vim /etc/hosts
SQL Server 2019 for Linux - ssh-keygen
hosts

3、将hosts同步到其他节点

for a in {01..03} ; do scp /etc/hosts sqlag$a:/etc/hosts ; done

4、编辑/etc/ssh/sshd_config

PubkeyAuthentication yes参数取消注释
PasswordAuthentication no参数取消注释

vim /etc/ssh/sshd_config

5、将/etc/ssh/sshd_config同步到其他节点

for a in {01..03} ; do scp /etc/ssh/sshd_config sqlag$a:/etc/ssh/sshd_config ; done

6、登陆sqlag01创建ssh-keygen

ssh-keygen -t rsa -P ''

7、将公钥id_rsa.pub写入到authorized_keys

for a in {01..03} ; do ssh sqlag$a cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys ; done

8、重启sshd服务

systemctl restart sshd.service

此文章为原创文章,作者:胖哥叨逼叨,如若转载,请与我联系并注明出处:https://www.pangshare.com/2544.htm

发表评论

电子邮件地址不会被公开。 必填项已用*标注