SSH/SHH-COPY-ID适用于root,但其他用户不适合

发布于 2025-02-01 05:07:08 字数 226 浏览 2 评论 0原文

我正在尝试通过ssh-copy-id将SSH作为非根用户进入我的Ubuntu服务器。在我的本地计算机上ssh-copy-id root@server正常工作,但是当我运行ssh-copy-id其他@server时,我会获得允许拒绝(publicKey)。错误。 主页/其他目录是完全空的。作为对方用户,我该怎么办才能使用SSH

I am trying to enable SSH into my Ubuntu server as a non-root user via ssh-copy-id. On my local machine ssh-copy-id root@server works fine but when I run ssh-copy-id other@server I get a Permission denied (publickey). error. The home/other directory is completely empty. What do I have to do to utilize an ssh as the other user

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风渺 2025-02-08 05:07:08

在远程计算机上,创建./ ssh在其他用户目录内部的文件夹。然后在此目录的内部创建一个名为授权的文件的文件。将公共密钥从本地主机复制到此文件中,您现在可以通过ssh other@s​​erver进入服务器中的SSH

On your remote machine create a ./ssh folder inside of the other users directory. Then inside of this directory create a file called authorized_keys. Copy the public key from your local host into this file, you will now be able to ssh into your server via ssh other@server

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文