MrNiebit / -solo-blog

comment
0 stars 0 forks source link

linux常用命令 - gitsilence 的个人博客 #16

Open MrNiebit opened 4 years ago

MrNiebit commented 4 years ago

http://blog.lacknb.cn/articles/2019/10/10/1577974148936.html

linux常用命令 多个linux服务器之间的免密登录 三台服务器如下: IPReleaseHostname 192.168.100.1centosserver-01 192.168.100.2centosserver-02 192.168.100.3centosserver-03 实现server-01免密登录server-02和server-03 在服务器server-01中运行指令, 然后一路回车即可. 指令: ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.100.2 root@server-01:/# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): #回车代表无需密码登录 Enter passphrase (empty for no passphrase): #回车 Enter same passphrase ....

MrNiebit commented 4 years ago

1.拷贝本地主机的公钥到远程主机: scp id_rsa.pub 2.将本地主机的公钥加到远程主机的授权列表 .ssh/authorized_keys 若不存在,手动创建: cat id_rsa.pub >> authorized_keys 3..ssh目录的权限必须是700 ,chmod 700 .ssh 4.授权列表authorized_keys的权限必须是600,chmod 600 authorized_keys

MrNiebit commented 3 years ago

解压 tar xf 文件名

压缩 tar cf 文件名 目录

解压到指定目录下,指定到目录要存在 tar xf 文件名 -C 目录/