Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想启动驻留在另一个网络中的另一台 linux 机器上的应用程序服务器,因此需要 SSH。我该怎么做?像这样的东西?:
ssh user@host password /home/user/server/bin/run.sh
?
您可以使用命令生成一个 ssh 公钥/私钥对ssh-keygen,然后将您的公钥附加到目标主机的 .ssh/authorized_keys 文件中,然后您可以省略上面的“密码”部分。
ssh-keygen
ssh-keygen -t rsa scp .ssh/id_rsa.pub user@host:.ssh/authorized_keys ssh user@host chmod og-rw .ssh/authorized_keys chmod a-x .ssh/authorized_keys chmod 700 .ssh