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.
我有一个 ec2 实例。我有一个私人腻子钥匙。目前我以root用户身份登录。所以我创建了一个新用户,但无法使用这个腻子键直接以新用户身份登录。这个腻子键是否特定于实例用户。请帮忙。
是的。您需要将您的公钥添加到用户authorized_keys文件中,以便与该用户一起使用您的密钥。
authorized_keys
您的 putty 密钥确实有一个公共部分,该部分存储在您要访问的服务器上。如果它适用于 root 用户,则它位于 root 用户的authorized_keys文件中。在这里找到文件/root/.ssh/authorized_keys。该文件将为/home/username/.ssh/authorized_keys所有其他用户提供。如果它不在那里,您可以创建它,但要注意权限。
/root/.ssh/authorized_keys
/home/username/.ssh/authorized_keys