Добрый день.Сгенерил rsa ключ( ssh-keygen -t rsa), но он какой-то странный :)
Отчего может возникнуть такая ошибка? Как ее можно исправить?#ssh-add
Configuration option RSAAuthentication is deprecated.
/root/.ssh2/id_rsa.pub: 4: parsing line failed.
/root/.ssh2/id_rsa.pub: 5: parsing line failed.
/root/.ssh2/id_rsa.pub: 6: parsing line failed.
/root/.ssh2/id_rsa.pub: 7: parsing line failed.
/root/.ssh2/id_rsa.pub: 8: parsing line failed.
/root/.ssh2/id_rsa.pub: 9: parsing line failed.
# ssh2 -d 1 192.168.10.252 -p 23
warning: Configuration option RSAAuthentication is deprecated.
debug: Connecting to 192.168.10.252, port 23... (SOCKS not used)
debug: client supports 3 auth methods: 'publickey,keyboard-interactive,password'
debug: Ssh2Common/sshcommon.c:530/ssh_common_wrap: local ip = 192.168.10.242, local port = 37460
debug: Ssh2Common/sshcommon.c:532/ssh_common_wrap: remote ip = 192.168.10.252, remote port = 23
debug: Remote version: SSH-2.0-3.2.2 SSH Secure Shell (non-commercial)
debug: Major: 3 Minor: 2 Revision: 2
debug: Remote host key found from database.
debug: server offers auth methods 'publickey'.
warning: /root/.ssh2/id_rsa.pub: 4: parsing line failed.
warning: /root/.ssh2/id_rsa.pub: 5: parsing line failed.
warning: /root/.ssh2/id_rsa.pub: 6: parsing line failed.
warning: /root/.ssh2/id_rsa.pub: 7: parsing line failed.
warning: /root/.ssh2/id_rsa.pub: 8: parsing line failed.
warning: /root/.ssh2/id_rsa.pub: 9: parsing line failed.
debug: server offers auth methods 'publickey'.
warning: Authentication failed.
debug: Ssh2/ssh2.c:168/client_disconnect: locally_generated = TRUE
Disconnected; no more authentication methods available (No further authentication methods available.).
>Добрый день.
>
>Сгенерил rsa ключ( ssh-keygen -t rsa), но он какой-то странный :)
>Отчего может возникнуть такая ошибка? Как ее можно исправить?
>
>#ssh-add
>Configuration option RSAAuthentication is deprecated.
>/root/.ssh2/id_rsa.pub: 4: parsing line failed.
>/root/.ssh2/id_rsa.pub: 5: parsing line failed.
>/root/.ssh2/id_rsa.pub: 6: parsing line failed.
>/root/.ssh2/id_rsa.pub: 7: parsing line failed.
>/root/.ssh2/id_rsa.pub: 8: parsing line failed.
>/root/.ssh2/id_rsa.pub: 9: parsing line failed.
>
>
># ssh2 -d 1 192.168.10.252 -p 23
>warning: Configuration option RSAAuthentication is deprecated.
>debug: Connecting to 192.168.10.252, port 23... (SOCKS not used)
>debug: client supports 3 auth methods: 'publickey,keyboard-interactive,password'
>debug: Ssh2Common/sshcommon.c:530/ssh_common_wrap: local ip = 192.168.10.242, local port = 37460
>debug: Ssh2Common/sshcommon.c:532/ssh_common_wrap: remote ip = 192.168.10.252, remote port = 23
>debug: Remote version: SSH-2.0-3.2.2 SSH Secure Shell (non-commercial)
>debug: Major: 3 Minor: 2 Revision: 2
>debug: Remote host key found from database.
>debug: server offers auth methods 'publickey'.
>warning: /root/.ssh2/id_rsa.pub: 4: parsing line failed.
>warning: /root/.ssh2/id_rsa.pub: 5: parsing line failed.
>warning: /root/.ssh2/id_rsa.pub: 6: parsing line failed.
>warning: /root/.ssh2/id_rsa.pub: 7: parsing line failed.
>warning: /root/.ssh2/id_rsa.pub: 8: parsing line failed.
>warning: /root/.ssh2/id_rsa.pub: 9: parsing line failed.
>debug: server offers auth methods 'publickey'.
>warning: Authentication failed.
>debug: Ssh2/ssh2.c:168/client_disconnect: locally_generated = TRUE
>Disconnected; no more authentication methods available (No further authentication methods available.).судя по всему - речь о "финском" SSH2, там ключи чуть иначе генерятся,
то что ты написал, это генерация для SSH1-compatible (в OpenSSH также генерятся)SSH2:
# ssh-keygen2 - генерация ключей
# ssh-keygen1 - генерация ключей для совместимости с SSH1почитай документацию, и на всякий случай посмотри - может у тебя оба
ssh'а установлены: OpenSSH и SSH2? (тогда можешь получить кашу из-за
использования утилит от одной реализации и демона от другой)
>>Добрый день.
>>
>>Сгенерил rsa ключ( ssh-keygen -t rsa), но он какой-то странный :)
>>Отчего может возникнуть такая ошибка? Как ее можно исправить?
>>
>>#ssh-add
>>Configuration option RSAAuthentication is deprecated.
>>/root/.ssh2/id_rsa.pub: 4: parsing line failed.
>>/root/.ssh2/id_rsa.pub: 5: parsing line failed.
>>/root/.ssh2/id_rsa.pub: 6: parsing line failed.
>>/root/.ssh2/id_rsa.pub: 7: parsing line failed.
>>/root/.ssh2/id_rsa.pub: 8: parsing line failed.
>>/root/.ssh2/id_rsa.pub: 9: parsing line failed.
>>
>>
>># ssh2 -d 1 192.168.10.252 -p 23
>>warning: Configuration option RSAAuthentication is deprecated.
>>debug: Connecting to 192.168.10.252, port 23... (SOCKS not used)
>>debug: client supports 3 auth methods: 'publickey,keyboard-interactive,password'
>>debug: Ssh2Common/sshcommon.c:530/ssh_common_wrap: local ip = 192.168.10.242, local port = 37460
>>debug: Ssh2Common/sshcommon.c:532/ssh_common_wrap: remote ip = 192.168.10.252, remote port = 23
>>debug: Remote version: SSH-2.0-3.2.2 SSH Secure Shell (non-commercial)
>>debug: Major: 3 Minor: 2 Revision: 2
>>debug: Remote host key found from database.
>>debug: server offers auth methods 'publickey'.
>>warning: /root/.ssh2/id_rsa.pub: 4: parsing line failed.
>>warning: /root/.ssh2/id_rsa.pub: 5: parsing line failed.
>>warning: /root/.ssh2/id_rsa.pub: 6: parsing line failed.
>>warning: /root/.ssh2/id_rsa.pub: 7: parsing line failed.
>>warning: /root/.ssh2/id_rsa.pub: 8: parsing line failed.
>>warning: /root/.ssh2/id_rsa.pub: 9: parsing line failed.
>>debug: server offers auth methods 'publickey'.
>>warning: Authentication failed.
>>debug: Ssh2/ssh2.c:168/client_disconnect: locally_generated = TRUE
>>Disconnected; no more authentication methods available (No further authentication methods available.).
>
>судя по всему - речь о "финском" SSH2, там ключи чуть иначе
>генерятся,
>то что ты написал, это генерация для SSH1-compatible (в OpenSSH также генерятся)
>
>
>SSH2:
>
># ssh-keygen2 - генерация ключей
># ssh-keygen1 - генерация ключей для совместимости с SSH1
>
>почитай документацию, и на всякий случай посмотри - может у тебя оба
>
>ssh'а установлены: OpenSSH и SSH2? (тогда можешь получить кашу из-за
>использования утилит от одной реализации и демона от другой)С этим разобрался.
Теперь все ок, но при попытке соединения сервер в лог пишет:
sshd2[16325]: no more authentication methods on remote: 'No further authentication methods available.'Хотя метод используется publickey.
Ну и соответственно клиент:
#/system/ssh/bin/ssh -i ./id_rsa.pub -d 1 192.168.10.252 -p 23
warning: Configuration option RSAAuthentication is deprecated.
debug: Connecting to 192.168.10.252, port 23... (SOCKS not used)
debug: client supports 3 auth methods: 'publickey,keyboard-interactive,password'
debug: Ssh2Common/sshcommon.c:530/ssh_common_wrap: local ip = 192.168.10.242, local port = 49315
debug: Ssh2Common/sshcommon.c:532/ssh_common_wrap: remote ip = 192.168.10.252, remote port = 23
debug: Remote version: SSH-2.0-3.2.2 SSH Secure Shell (non-commercial)
debug: Major: 3 Minor: 2 Revision: 2
debug: Remote host key found from database.
debug: server offers auth methods 'publickey'.
debug: server offers auth methods 'publickey'.
warning: Authentication failed.
debug: Ssh2/ssh2.c:168/client_disconnect: locally_generated = TRUE
Disconnected; no more authentication methods available (No further authentication methods available.).
>С этим разобрался.
>Теперь все ок, но при попытке соединения сервер в лог пишет:
>
>sshd2[16325]: no more authentication methods on remote: 'No further authentication methods available.'
>
>
>Хотя метод используется publickey.
>Ну и соответственно клиент:
>#/system/ssh/bin/ssh -i ./id_rsa.pub -d 1 192.168.10.252 -p 23
>warning: Configuration option RSAAuthentication is deprecated.имеем выше запуск клиента с попыткой авторизации по публичным ключам rsa
и соединением на tcp/23 - и что там на нем висит?# telnet 192.168.10.252 23
что в ответ скажет?на удаленной стороне выложены публичные ключи в нужный файл в нужное
место? SSHD на удаленной стороне какую авторизацию позволяет?>debug: Connecting to 192.168.10.252, port 23... (SOCKS not used)
>debug: client supports 3 auth methods: 'publickey,keyboard-interactive,password'
>debug: Ssh2Common/sshcommon.c:530/ssh_common_wrap: local ip = 192.168.10.242, local port = 49315
>debug: Ssh2Common/sshcommon.c:532/ssh_common_wrap: remote ip = 192.168.10.252, remote port = 23
>debug: Remote version: SSH-2.0-3.2.2 SSH Secure Shell (non-commercial)
>debug: Major: 3 Minor: 2 Revision: 2
>debug: Remote host key found from database.
>debug: server offers auth methods 'publickey'.
>debug: server offers auth methods 'publickey'.
>warning: Authentication failed.
>debug: Ssh2/ssh2.c:168/client_disconnect: locally_generated = TRUE
>Disconnected; no more authentication methods available (No further authentication methods available.).похоже на то что удаленный SSH не поддерживает SSH1 и как результат
RSA авторизацию от SSH1 (я так понимаю именно это задается при запуске)Sorry, я давно не использую финский SSH и не помню ключей, диагностики
& etc, но что мешает воспользоваться DSA, что-то подсказывает что проблем
не будет, тем более что это SSH-Protocol-2
>>С этим разобрался.
>>Теперь все ок, но при попытке соединения сервер в лог пишет:
>>
>>sshd2[16325]: no more authentication methods on remote: 'No further authentication methods available.'
>>
>>
>>Хотя метод используется publickey.
>>Ну и соответственно клиент:
>>#/system/ssh/bin/ssh -i ./id_rsa.pub -d 1 192.168.10.252 -p 23
>>warning: Configuration option RSAAuthentication is deprecated.
>
>имеем выше запуск клиента с попыткой авторизации по публичным ключам rsa
>и соединением на tcp/23 - и что там на нем висит?
>
># telnet 192.168.10.252 23
>что в ответ скажет?
>
>на удаленной стороне выложены публичные ключи в нужный файл в нужное
>место? SSHD на удаленной стороне какую авторизацию позволяет?
>
>>debug: Connecting to 192.168.10.252, port 23... (SOCKS not used)
>>debug: client supports 3 auth methods: 'publickey,keyboard-interactive,password'
>>debug: Ssh2Common/sshcommon.c:530/ssh_common_wrap: local ip = 192.168.10.242, local port = 49315
>>debug: Ssh2Common/sshcommon.c:532/ssh_common_wrap: remote ip = 192.168.10.252, remote port = 23
>>debug: Remote version: SSH-2.0-3.2.2 SSH Secure Shell (non-commercial)
>>debug: Major: 3 Minor: 2 Revision: 2
>>debug: Remote host key found from database.
>>debug: server offers auth methods 'publickey'.
>>debug: server offers auth methods 'publickey'.
>>warning: Authentication failed.
>>debug: Ssh2/ssh2.c:168/client_disconnect: locally_generated = TRUE
>>Disconnected; no more authentication methods available (No further authentication methods available.).
>
>похоже на то что удаленный SSH не поддерживает SSH1 и как результат
>
>RSA авторизацию от SSH1 (я так понимаю именно это задается при запуске)
>
>
>Sorry, я давно не использую финский SSH и не помню ключей, диагностики
>
>& etc, но что мешает воспользоваться DSA, что-то подсказывает что проблем
>не будет, тем более что это SSH-Protocol-2Была выполненна следующая последовательность действий:
#ssh-keygen2 -t rsa
#echo "IdKey id_rsa_2048_a" >~/.ssh2/identification
#scp id_rsa_2048_a.pub 192.168.10.252:.ssh2/
#ssh2 192.168.10.252
host192.168.10.252#echo "Key id_rsa_2048_a.pub" >~/.ssh2/authorizationЗатем:
#ssh -d 1 192.168.10.252 -p 23
debug: SshConfig/sshconfig.c:2704/ssh2_parse_config_ext: Unable to open /root/.ssh2/ssh2_config
debug: Connecting to 192.168.10.252, port 23... (SOCKS not used)
debug: client supports 3 auth methods: 'publickey,keyboard-interactive,password'
debug: Ssh2Common/sshcommon.c:530/ssh_common_wrap: local ip = 192.168.10.242, local port = 52861
debug: Ssh2Common/sshcommon.c:532/ssh_common_wrap: remote ip = 192.168.10.252, remote port = 23
debug: Remote version: SSH-2.0-3.2.2 SSH Secure Shell (non-commercial)
debug: Major: 3 Minor: 2 Revision: 2
debug: Remote host key found from database.
debug: server offers auth methods 'publickey'.
debug: server offers auth methods ''.
warning: Authentication failed.
debug: Ssh2/ssh2.c:168/client_disconnect: locally_generated = TRUE
Disconnected; no more authentication methods available (No further authentication methods available.).#telnet 192.168.10.252 23
Trying 192.168.10.252...
Connected to 192.168.10.252.
Escape character is '^]'.
SSH-2.0-3.2.2 SSH Secure Shell (non-commercial)host192.168.10.252## tail -400 /var/log/messages | grep ssh
sshd2[23507]: Daemon is running.
sshd2[23507]: connection from "192.168.10.242"
sshd2[23620]: publickey authentication failed. Connection from 192.168.10.242 denied. Authentication as user root was attempted.
sshd2[23620]: Remote host disconnected: No further authentication methods available.
sshd2[23620]: no more authentication methods on remote: 'No further authentication methods available.'
sshd2[23507]: connection from "192.168.10.242"
sshd2[23674]: publickey authentication failed. Connection from 192.168.10.242 denied. Authentication as user root was attempted.
sshd2[23674]: Remote host disconnected: No further authentication methods available.
sshd2[23674]: no more authentication methods on remote: 'No further authentication methods available.'
Конфиг сервера:
## GeneralHostKeyFile hostkey
PublicHostKeyFile hostkey.pub
PubkeyAuthentication yes## Network
Port 23
ListenAddress 192.168.10.252
ResolveClientHostName no
RequireReverseMapping yes
KeepAlive yes
MaxConnections 0## Crypto
Ciphers AnyCipher
## Authentication
AllowedAuthentications publickey
RequiredAuthentications publickey## Host restrictions
AllowHosts \m192.168.10.0/24
## SSH1 compatibility
Ssh1Compatibility yes
Sshd1ConfigFile /sysconfig/ssh/etc/sshd1_config## Subconfiguration
subsystem-sftp sftp-server
UserSpecificConfig .* /system/ssh/etc/sub_config_rsyncRSAAuthentication yes
>Была выполненна следующая последовательность действий:
>#ssh-keygen2 -t rsa
>#echo "IdKey id_rsa_2048_a" >~/.ssh2/identification
>#scp id_rsa_2048_a.pub 192.168.10.252:.ssh2/
>#ssh2 192.168.10.252
>host192.168.10.252#echo "Key id_rsa_2048_a.pub" >~/.ssh2/authorizationбоюсь что для authorization не все, посмотри в дистрибутиве SSH2
FAQ и SSH2.QUICKSTART>Затем:
>#ssh -d 1 192.168.10.252 -p 23
>debug: SshConfig/sshconfig.c:2704/ssh2_parse_config_ext: Unable to open /root/.ssh2/ssh2_configпишет что не может найти файл конфигурации клиента: ssh2_config
>debug: Connecting to 192.168.10.252, port 23... (SOCKS not used)
>debug: client supports 3 auth methods: 'publickey,keyboard-interactive,password'
>debug: Ssh2Common/sshcommon.c:530/ssh_common_wrap: local ip = 192.168.10.242, local port = 52861
>debug: Ssh2Common/sshcommon.c:532/ssh_common_wrap: remote ip = 192.168.10.252, remote port = 23
>debug: Remote version: SSH-2.0-3.2.2 SSH Secure Shell (non-commercial)
>debug: Major: 3 Minor: 2 Revision: 2
>debug: Remote host key found from database.
>debug: server offers auth methods 'publickey'.
>debug: server offers auth methods ''.
>warning: Authentication failed.
>debug: Ssh2/ssh2.c:168/client_disconnect: locally_generated = TRUE
>Disconnected; no more authentication methods available (No further authentication methods available.).
>
>#telnet 192.168.10.252 23
>Trying 192.168.10.252...
>Connected to 192.168.10.252.
>Escape character is '^]'.
>SSH-2.0-3.2.2 SSH Secure Shell (non-commercial)пишет что поддерживается только SSH-Protocol-2 (если захочешь
использовать авторизацию от SSH1, то до установки SSH2 должен был быть
установлен SSH1 как я понимаю...)>host192.168.10.252## tail -400 /var/log/messages | grep ssh
>sshd2[23507]: Daemon is running.
>sshd2[23507]: connection from "192.168.10.242"
>sshd2[23620]: publickey authentication failed. Connection from 192.168.10.242 denied. Authentication as user root
>was attempted.
>sshd2[23620]: Remote host disconnected: No further authentication methods available.
>sshd2[23620]: no more authentication methods on remote: 'No further authentication methods available.'
>
>sshd2[23507]: connection from "192.168.10.242"
>sshd2[23674]: publickey authentication failed. Connection from 192.168.10.242 denied. Authentication as user root
>was attempted.
>sshd2[23674]: Remote host disconnected: No further authentication methods available.
>sshd2[23674]: no more authentication methods on remote: 'No further authentication methods available.'
>
>
>
>Конфиг сервера:
>## General
>
> HostKeyFile
>
> hostkey
> PublicHostKeyFile
>
>hostkey.pub
> PubkeyAuthentication
> yes
>
>## Network
>
> Port
>
>
> 23
> ListenAddress
>
> 192.168.10.252
> ResolveClientHostName
> no
> RequireReverseMapping
> yes
> KeepAlive
>
> yes
> MaxConnections
>
> 0
>
>## Crypto
>
> Ciphers
>
> AnyCipher
>
>
>## Authentication
>
> AllowedAuthentications
> publickey
> RequiredAuthentications
> publickeyэто обрезок, в Allowed нужно записать все необходимые методы авторизации
в нужном порядке:AllowedAuthentications hostbased,publickey,keyboard-interactive,password
а в Required - то что должно затребоваться в случае непрохождения вроде
RequiredAuthentications publickey,password
иначе, если у тебя авторизация по публичным ключам не прошла, то до
keyboard-interactive или password - дело не дойдет и будешь ломать
голову почему ВООБЩЕ не работает>## Host restrictions
>
> AllowHosts
> \m192.168.10.0/24
>
>
>## SSH1 compatibility
>
> Ssh1Compatibility
>
>yes
> Sshd1ConfigFile
>
> /sysconfig/ssh/etc/sshd1_config
>
>## Subconfiguration
> subsystem-sftp
>
> sftp-server
> UserSpecificConfig .* /system/ssh/etc/sub_config_rsync
>
> RSAAuthentication yesчтобы проходила авторизация по публичным ключам, нужно с помощью ssh-add2
скормить ключи агенту ssh-agent - смотри в документации что я тебе написал
и все получиться:# ssh-add2 -l
# man ssh-add2
# man ssh-agent2перед тем как заходить на remote по ssh, посмотри на локальной и сделай: ssh-add2 -l , если пусто:
- запусти ssh-agent2
- скорми ему ключи ssh-add2после чего можешь использовать публичную авторизацию для захода на remote
Sorry, больше разжевывать не буду, тем более что не использую SSH2 и
смотреть-проверять не на чем, а городить у себя SSH2 при наличии удобного
OpenSSH просто нет.