http://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F202005%2F08%2F20200508102713_L8aCB.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1649077062&t=40b7b14053ef546a57de4934b9442cbe",

SSH配置(同一服务器不同用户)

一、cxwh用户ssh免密登陆至xtjk用户

1、cxwh用户执行

ssh-keygen -t rsa -N "" -f /home/cxwh/.ssh/id_rsa
cp /home/cxwh/.ssh/id_rsa.pub /tmp/id_rsa.pub

2、xtjk用户执行

mkdir -p -m 700 /home/cib/.ssh/
echo `cat /tmp/id_rsa.pub` >> /home/cib/.ssh/authorized_keys
chmod 600 /home/cib/.ssh/authorized_keys

3、至此,cxwh用户可ssh切换至xtjk用户

ssh xtjk@[hostname]
posted @ 2019-09-15 01:33  DeepInThought  阅读(1032)  评论(0编辑  收藏  举报