>Была выполненна следующая последовательность действий:
>#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 просто нет.