19 / 19 / 0
Регистрация: 14.09.2010
Сообщений: 136
|
|
1 | |
ssh доступ с использованием rsa ключей14.09.2010, 18:02. Показов 5456. Ответов 11
Метки нет (Все метки)
Привет всем
Есть вопрос Настраиваю ssh доступ с иползованием rsa ключей с windows машины Делаю все как в мане http://vlad.design.com.ua/2009... a-freebsd/ конфиг sshd # $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $ # $FreeBSD: src/crypto/openssh/sshd_config,v 1.47.2.2.2.1 2008/11/25 02:59:29 kensmith Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin # The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options change a # default value. # Note that some of FreeBSD's defaults differ from OpenBSD's, and # FreeBSD has a few additional options. #VersionAddendum FreeBSD-20080901 #Port 22 #Protocol 2 #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: # Disable legacy (protocol version 1) support in the server for new # installations. In future the default will change to require explicit # activation of protocol 1 Protocol 2 # HostKey for protocol version 1 #HostKey /etc/ssh/ssh_host_key # HostKeys for protocol version 2 #HostKey /etc/ssh/ssh_host_dsa_key # Lifetime and size of ephemeral version 1 server key #KeyRegenerationInterval 1h #ServerKeyBits 1024 # Logging # obsoletes QuietMode and FascistLogging #SyslogFacility AUTH #LogLevel INFO # Authentication: #LoginGraceTime 2m PermitRootLogin yes #StrictModes yes #MaxAuthTries 6 #MaxSessions 10 RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys2 # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts RhostsRSAAuthentication no # similar for protocol version 2 HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # RhostsRSAAuthentication and HostbasedAuthentication #IgnoreUserKnownHosts no # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes # Change to yes to enable built-in password authentication. PasswordAuthentication no PermitEmptyPasswords no # Change to no to disable PAM authentication #ChallengeResponseAuthentication yes # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no # GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes # Set this to 'no' to disable 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 #AllowAgentForwarding yes #AllowTcpForwarding yes #GatewayPorts no #X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes #PrintMotd yes #PrintLastLog yes #TCPKeepAlive yes UseLogin no #UsePrivilegeSeparation yes #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 #ClientAliveCountMax 3 #UseDNS yes #PidFile /var/run/sshd.pid #MaxStartups 10 #PermitTunnel no #ChrootDirectory none # no default banner path #Banner none # override default of no subsystems Subsystem sftp /usr/libexec/sftp-server IgnoreRhosts yes IgnoreUserKnownHosts yes PrintMotd yes StrictModes yes # Example of overriding settings on a per-user basis #Match User anoncvs # X11Forwarding no # AllowTcpForwarding no # ForceCommand cvs server При входе Using username "skull" . Server refused our key Using keyboard-interactive authentication. Password: В чем проблема ?
0
|
14.09.2010, 18:02 | |
Ответы с готовыми решениями:
11
Вход через SSH с использованием ключей Доступ по ssh и генерация ключей через cpanel Как изменить ssh ключ локального репозитория, что бы был он, а не id.rsa из папки .ssh? RSA - создание ключей |
7175 / 3234 / 81
Регистрация: 17.06.2009
Сообщений: 14,164
|
|
14.09.2010, 20:26 | 2 |
FreeBSD какой версии ?
Ты этот конфиг sshd не менял ? Посмотри в логах - причину отказа Может ты права на .ssh неправильные сделал
0
|
19 / 19 / 0
Регистрация: 14.09.2010
Сообщений: 136
|
|
14.09.2010, 22:21 [ТС] | 4 |
- FreeBSD 7.1
- конфиг не менял (разкоментировал строки PasswordAuthentication no PermitEmptyPasswords no UseLogin no RSAAuthentication yes PubkeyAuthentication yes ) AuthorizedKeysFile .ssh/authorized_keys2 - файл присутствует права на файл и .ssh/ - 700 Добавлено через 1 минуту насчет логов сказать не могу - ибо машина на работе завтра гляну - отпишусь Добавлено через 1 минуту генерация , импорт ключей и настройка putty - согласно инструкции http://vlad.design.com.ua/2009... a-freebsd/
0
|
19 / 19 / 0
Регистрация: 14.09.2010
Сообщений: 136
|
|
14.09.2010, 22:40 [ТС] | 6 |
?
(насчет имени файла AuthorizedKeysFile .ssh/authorized_keys2 так меняно было)
0
|
19 / 19 / 0
Регистрация: 14.09.2010
Сообщений: 136
|
|
14.09.2010, 22:46 [ТС] | 8 |
KerberosAuthentication no
? Добавлено через 2 минуты прошу не пинать - настраиваю впервые
0
|
13009 / 7401 / 800
Регистрация: 09.09.2009
Сообщений: 28,968
|
|
14.09.2010, 22:51 | 9 |
да нет, я просто у себя (В СЕРВЕРЕ) в папке .ssh переименовал файл authorized_keys в файл authorized_keys.bak
а вот манипуляции с файлом authorized_keys2 (переименование, удаление) абсолютно никак не повлияли на вход в консоль по ключу. В принципе, вот мой талмуд по настройке путти http://dmitrykhn.homedns.org/w... m-windows/ рабтает все уже несолько лет. но скажу сразу, у меня в сервере в конфиге sshd строка AuthorizedKeysFile .ssh/authorized_keys2 закомментирована. а ключ импортирован (как и в той инструкции, на которую вы давали ссылку) в файл $HOME/.ssh/authorized_keys (без двойки)
0
|
19 / 19 / 0
Регистрация: 14.09.2010
Сообщений: 136
|
|
15.09.2010, 12:06 [ТС] | 10 |
скорее
KerberosOrLocalPasswd no Добавлено через 1 минуту dmkhn, огромное спасибо Добавлено через 13 часов 13 минут еще вопрос Для одного пользователя сделал - все ок при добавлении ключей для другого (понятно что делаю под другим пользователем) имею ошибку $ ssh-keygen -i -f key.pub >> $HOME/.ssh/authorized_keys buffer_get_ret: trying to get more bytes 4 than in buffer 0 buffer_get_int: buffer error $ в чем проблема ?
0
|
19 / 19 / 0
Регистрация: 14.09.2010
Сообщений: 136
|
|
15.09.2010, 13:21 [ТС] | 12 |
все , разобрался
0
|
15.09.2010, 13:21 | |
15.09.2010, 13:21 | |
Помогаю со студенческими работами здесь
12
Генератор ключей RSA Генератор rsa-ключей RSA создание ключей SSH, RSA key RSA. Сохранение ключей в базе данних Аутентификация по ssh, rsa, механизм работы Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |