代码之家  ›  专栏  ›  技术社区  ›  matpie

不带主目录的用户的SSH公钥

  •  3
  • matpie  · 技术社区  · 16 年前

    我正在运行一个MacOSXLeopard服务器,我创建了一个新用户,但没有为该用户指定主目录。是否可以让该用户使用公钥进行身份验证?

    我知道当一个用户 ~/.ssh/authorized_keys

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

    1 回复  |  直到 16 年前
        1
  •  10
  •   Johannes Weiss    16 年前

    你必须编辑 /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''.
    

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