没有主目录的用户的 SSH 公钥

发布于 2024-07-14 21:36:46 字数 313 浏览 7 评论 0原文

我正在运行 Mac OS X Leopard Server,并且创建了一个新用户,但没有为该用户指定主目录。 是否可以让该用户使用公钥进行身份验证?

我知道当用户有主目录时,它会进入~/.ssh/authorized_keys

我不想为该用户创建主目录,因为我的据了解,如果给予物理访问权限,它将允许他们登录。

更新:我只需要允许该用户进行安全 FTP 连接。 将登录外壳设置为 /bin/false/ 也会阻止它们远程连接。

I'm running a Mac OS X Leopard Server and I created a new user without designating a home directory for that user. Is it possible to have that user authenticate using a Public Key?

I know that when a user does have a home directory it goes in to ~/.ssh/authorized_keys

I don't want to create a home directory for this user because my understanding is it would then allow them to login if given physical access.

UPDATE: I need to allow this user to do a Secure FTP connection only. Setting the Login Shell to /bin/false/ will prevent them from connecting remotely as well.

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

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

发布评论

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

评论(1

陈独秀 2024-07-21 21:36:46

您必须编辑 /etc/ssh/sshd_config 或它在计算机上的位置,并更改 AuthorizedKeysFile 设置。

文档说:

 AuthorizedKeysFile
         Specifies the file that contains the public keys that can be used
         for user authentication.  AuthorizedKeysFile may contain tokens of
         the form %T which are substituted during connection setup.  The fol-
         lowing tokens are defined: %% is replaced by a literal '%', %h is
         replaced by the home directory of the user being authenticated, and
         %u is replaced by the username of that user.  After expansion,
         AuthorizedKeysFile is taken to be an absolute path or one relative
         to the user's home directory.  The default is
         ``.ssh/authorized_keys''.

但是为什么你的用户(可以登录)没有家呢?

You have to edit /etc/ssh/sshd_config or where it is located on your machine and change the AuthorizedKeysFile setting.

The docs say:

 AuthorizedKeysFile
         Specifies the file that contains the public keys that can be used
         for user authentication.  AuthorizedKeysFile may contain tokens of
         the form %T which are substituted during connection setup.  The fol-
         lowing tokens are defined: %% is replaced by a literal '%', %h is
         replaced by the home directory of the user being authenticated, and
         %u is replaced by the username of that user.  After expansion,
         AuthorizedKeysFile is taken to be an absolute path or one relative
         to the user's home directory.  The default is
         ``.ssh/authorized_keys''.

But why do you have users (that can login) without a home?

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