我正在Linode上设置一个服务器,并按照他们的安全服务器指南。
他们build议设置SSH密钥对authentication。 我已经上传我的公钥到服务器和密钥对身份validation似乎工作正常,但如果下面的行在sshd_config注释掉它是如何工作的:
#AuthorizedKeysFile %h/.ssh/authorized_keys
这是默认位置。 您可以使用AuthorizedKeysFile更改到不同的位置,但是如果您不指定它,那么它将在~/.ssh/authorized_keys
从手册页(例如https://www.freebsd.org/cgi/man.cgi?query=sshd_config&sektion=5 ):
AuthorizedKeysFile
Specifies the file that contains the public keys that can be used for user authentication. The format is described in the AUTHO- RIZED_KEYS FILE FORMAT section of sshd(8). AuthorizedKeysFile may contain tokens of the form %T which are substituted during connection setup. The following 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 user- name of that user. After expansion, AuthorizedKeysFile is taken to be an absolute path or one relative to the user's home direc- tory. Multiple files may be listed, separated by whitespace. The default is ``.ssh/authorized_keys .ssh/authorized_keys2''.