简体   繁体   English

SSH 到集群中的其他服务器

[英]SSH to other servers in cluster

I had an user account set up by my collegue weeks ago, to access our server(rhel).几周前我的同事设置了一个用户帐户,用于访问我们的服务器(rhel)。 Now Im asked to copy my key so I can login to other servers in the cluster.现在我要求复制我的密钥,以便我可以登录集群中的其他服务器。
My first approach was to copy my /home/user/.ssh folder from the (already set-up) server to the new one.我的第一种方法是将我的 /home/user/.ssh 文件夹从(已经设置的)服务器复制到新的。 This one obviously fails, I found out with ls -a , that in my .ssh directory is only one file - known_hosts.这个显然失败了,我用 ls -a 发现,在我的 .ssh 目录中只有一个文件 - known_hosts。
Im bit confused from my search results, is it necessary to create a new private-public key pair (I dont have any log about creating in before for the first server, so it was probably already setup for me), or is it sufficient to copy files from the first server and setup owners and permissions?我对我的搜索结果有点困惑,是否有必要创建一个新的公私钥对(我之前没有任何关于为第一台服务器创建的日志,所以它可能已经为我设置了),或者是否足以从第一台服务器复制文件并设置所有者和权限?

What you're probably looking for is file ~/.ssh/authorized_keys on the server.您可能正在寻找的是服务器上的文件~/.ssh/authorized_keys If you have your key set up, your public key should be stored there.如果您设置了密钥,则您的公钥应该存储在那里。 If there is no such file, than you don't have your keys set up(do you have private keys files on your desktop?).如果没有这样的文件,那么您就没有设置密钥(您的桌面上是否有私钥文件?)。 Please note that for usually ssh will require strict access permissions( rwx for user only) for your ~/.ssh directory and authorized_keys file.请注意,通常 ssh 需要对您的~/.ssh目录和authorized_keys文件进行严格的访问权限(仅限用户rwx )。

Also you can use as many and as few keys as you wish, depending on your security needs.此外,您可以根据需要使用任意数量的密钥,具体取决于您的安全需求。 So using single key pair for multiple servers is possible.因此,可以为多个服务器使用单个密钥对。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM