давайте представим, что у меня есть имя пользователя: exuser
Мой локальный конфигурационный файл SSH:
Host app.example.com
HostName app.example.com
User exuser
IdentitiesOnly yes
IdentityFile ~/.ssh/exuser@app.example.com
Port 2853
Когда я пытаюсь подключиться, у меня есть ошибка: Permission denied (publickey ).
Найден на стороне сервера auth.log:
Не удалось открыть авторизованные ключи /home/exuser/.ssh/authorized_keys':Нет такого файла или каталогаls -l /home/exuser/ | grep ssh:
drwx------ 2 exuser exuser 4096 Dec 5 21:42 .ssh
ls -l /home/exuser/.ssh/:
-rw------- 1 exuser exuser 409 Aug 30 14:23 authorized_keys
Параметры sshd_config:
Port 2853
Protocol 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
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 1024
SyslogFacility AUTH
LogLevel DEBUG
LoginGraceTime 120
PermitRootLogin prohibit-password
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
PasswordAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
MaxStartups 20
AcceptEnv LANG LC_*
UsePAM yes
Subsystem sftp internal-sftp
Match group ftpaccess
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
Если у меня есть открытый сеанс от клиента VNC (ISP vm manager), все в порядке, и я могу открыть сеанс ssh с моего рабочего стола без какой-либо ошибки .
Не удалось открыть авторизованные ключи /home/exuser/.ssh/authorized_keys':Нет такого файла или каталога
sshd [28467]: debug1 : найденный ключ соответствия: файл /home/exuser/.ssh/authorized_keys, строка 1 RSA SHA256: blah blah
Эта ошибка появится снова, если я перейду к настольной системе (Ubuntu заблокирует закрытый ключ) или удалить файл known_hosts.