конфигурация sshd для использования Ключей SSH

18,10 установок. Я спрашиваю о sshd_config/etc/ssh/)

Как я разрешаю/аутентифицирую sshd ключи?

Когда я вхожу в систему от другого экземпляра Ubuntu, пароль хорошо работает. ssh-copy-id должен был настроить ключи в надлежащих файлах (проверенное разрешение на каталоге, файле ключей, authorizedhosts соответствие записей файла) Попытки к ssh во все еще потребованном пароле. Никакая ссылка в auth.log к попытке аутентификации.

Я не комментировал/разрешал, что один из хоста вводит существующее sshd_config

Я добавил AuthenticationMethods publickey, password строка.

(authenticationmethods ранее не существовал в файле или был прокомментирован),

Последующая попытка соединиться была полностью заблокирована.

Когда я исследовал auth.log (debug1 уровень), я не видел, что любая ссылка на ключевую проверку была сделана.


В чем я должен настроить sshd_config чтобы ssh ключ был применим? Что я пропускаю?

(Я ожидал, что это будет работать из поля),

0
задан 12 January 2019 в 19:32

1 ответ

Ваш sshd_config пропускает много полей, которые имеет моя рабочая версия, mayge это - проблема. Здесь является моим, который делает keylogin для меня успешно, на основе образца в/usr/share/doc/openssh-client/examples/sshd_config

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin without-password
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
0
ответ дан 26 October 2019 в 13:37

Другие вопросы по тегам:

Похожие вопросы: