powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Unix-системы [игнор отключен] [закрыт для гостей] / беспарольный ssh между серверами Solaris 10
25 сообщений из 37, страница 1 из 2
беспарольный ssh между серверами Solaris 10
    #36293933
fabler
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Добрый день!

Тема избита, но никак между двумя серверами на Solaris постоить сабж не получается.
мой порядок действий:
на сервере-клиенте генерирую rsa ключ:
Код: plaintext
ssh-keygen -t rsa

копирую содержимое файла ~/.ssh/id_rsa.pub на сервер, куда собираюсь ходить без пароля, в файл ~/.ssh/authorized_keys

настройки sshd_config на сервере:

#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)sshd_config 1.8 04/05/10 SMI"
#
# Configuration file for sshd(1m)

# Protocol versions supported
#
# The sshd shipped in this release of Solaris has support for major versions
# 1 and 2. It is recommended due to security weaknesses in the v1 protocol
# that sites run only v2 if possible. Support for v1 is provided to help sites
# with existing ssh v1 clients/servers to transition.
# Support for v1 may not be available in a future release of Solaris.
#
# To enable support for v1 an RSA1 key must be created with ssh-keygen(1).
# RSA and DSA keys for protocol v2 are created by /etc/init.d/sshd if they
# do not already exist, RSA1 keys for protocol v1 are not automatically created.

# Uncomment ONLY ONE of the following Protocol statements.

# Only v2 (recommended)
Protocol 2

# Both v1 and v2 (not recommended)
#Protocol 2,1

# Only v1 (not recommended)
#Protocol 1

# Listen port (the IANA registered port number for ssh is 22)
Port 22

# The default listen address is all interfaces, this may need to be changed
# if you wish to restrict the interfaces sshd listens on for a multi homed host.
# Multiple ListenAddress entries are allowed.

# IPv4 only
#ListenAddress 0.0.0.0
# IPv4 & IPv6
ListenAddress ::

# Port forwarding
AllowTcpForwarding no

# If port forwarding is enabled, specify if the server can bind to INADDR_ANY.
# This allows the local port forwarding to work when connections are received
# from any remote host.
GatewayPorts no

# X11 tunneling options
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

# The maximum number of concurrent unauthenticated connections to sshd.
# start:rate:full see sshd(1) for more information.
# The default is 10 unauthenticated clients.
#MaxStartups 10:30:60

# Banner to be printed before authentication starts.
#Banner /etc/issue

# Should sshd print the /etc/motd file and check for mail.
# On Solaris it is assumed that the login shell will do these (eg /etc/profile).
PrintMotd no

# KeepAlive specifies whether keep alive messages are sent to the client.
# See sshd(1) for detailed description of what this means.
# Note that the client may also be sending keep alive messages to the server.
KeepAlive yes

# Syslog facility and level
SyslogFacility auth
LogLevel info

#
# Authentication configuration
#

# Host private key files
# Must be on a local disk and readable only by the root user (root:sys 600).
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key

# Default Encryption algorithms and Message Authentication codes
#Ciphers aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc
#MACS hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96

# Length of the server key
# Default 768, Minimum 512
ServerKeyBits 768

# sshd regenerates the key every KeyRegenerationInterval seconds.
# The key is never stored anywhere except the memory of sshd.
# The default is 1 hour (3600 seconds).
KeyRegenerationInterval 3600

# Ensure secure permissions on users .ssh directory.
StrictModes yes

# Length of time in seconds before a client that hasn't completed
# authentication is disconnected.
# Default is 600 seconds. 0 means no time limit.
LoginGraceTime 600

# Maximum number of retries for authentication
# Default is 6. Default (if unset) for MaxAuthTriesLog is MaxAuthTries / 2
MaxAuthTries 6
MaxAuthTriesLog 3

# Are logins to accounts with empty passwords allowed.
# If PermitEmptyPasswords is no, pass PAM_DISALLOW_NULL_AUTHTOK
# to pam_authenticate(3PAM).
PermitEmptyPasswords no

# To disable tunneled clear text passwords, change PasswordAuthentication to no.
PasswordAuthentication yes

# Use PAM via keyboard interactive method for authentication.
# Depending on the setup of pam.conf(4) this may allow tunneled clear text
# passwords even when PasswordAuthentication is set to no. This is dependent
# on what the individual modules request and is out of the control of sshd
# or the protocol.
PAMAuthenticationViaKBDInt yes

# Are root logins permitted using sshd.
# Note that sshd uses pam_authenticate(3PAM) so the root (or any other) user
# maybe denied access by a PAM module regardless of this setting.
# Valid options are yes, without-password, no.
PermitRootLogin no

# sftp subsystem
Subsystem sftp /usr/lib/ssh/sftp-server


# SSH protocol v1 specific options
#
# The following options only apply to the v1 protocol and provide
# some form of backwards compatibility with the very weak security
# of /usr/bin/rsh. Their use is not recommended and the functionality
# will be removed when support for v1 protocol is removed.

# Should sshd use .rhosts and .shosts for password less authentication.
IgnoreRhosts yes
RhostsAuthentication no

# Rhosts RSA Authentication
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts.
# If the user on the client side is not root then this won't work on
# Solaris since /usr/bin/ssh is not installed setuid.
RhostsRSAAuthentication no

# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication.
#IgnoreUserKnownHosts yes

# Is pure RSA authentication allowed.
# Default is yes
RSAAuthentication yes
IdentityFile ~/.ssh/id_rsa



ssh -d на сервер выдает следующее:

Sun_SSH_1.1.1, SSH protocols 1.5/2.0, OpenSSL 0x0090704f
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: ssh_connect: needpriv 0
debug1: Connecting to 10.2.133.85 [10.2.133.85] port 22.
debug1: Connection established.
debug1: identity file /export/home/ftpuser/.ssh/identity type -1
debug1: identity file /export/home/ftpuser/.ssh/id_rsa type 1
debug1: identity file /export/home/ftpuser/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version Sun_SSH_1.1
debug1: match: Sun_SSH_1.1 pat Sun_SSH_1.1*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-Sun_SSH_1.1.1
debug1: use_engine is 'yes'
debug1: pkcs11 engine initialized, now setting it as default for RSA, DSA, and symmetric ciphers
debug1: pkcs11 engine initialization complete
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
)
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: Peer sent proposed langtags, ctos: i-default
debug1: Peer sent proposed langtags, stoc: i-default
debug1: We proposed langtags, ctos: i-default
debug1: We proposed langtags, stoc: i-default
debug1: Negotiated lang: i-default
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: Remote: Negotiated main locale: C
debug1: Remote: Negotiated messages locale: C
debug1: dh_gen_key: priv key bits set: 137/256
debug1: bits set: 1554/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '10.2.133.85' is known and matches the RSA host key.
debug1: Found key in /export/home/ftpuser/.ssh/known_hosts:3
debug1: bits set: 1601/3191
debug1: ssh_rsa_verify: signature correct
debug1: newkeys: mode 1
debug1: set_newkeys: setting new keys for 'out' mode
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: set_newkeys: setting new keys for 'in' mode
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Next authentication method: gssapi-keyex
debug1: Next authentication method: gssapi-with-mic
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
)
debug1: Next authentication method: publickey
debug1: Trying private key: /export/home/ftpuser/.ssh/identity
debug1: Trying public key: /export/home/ftpuser/.ssh/id_rsa
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Trying private key: /export/home/ftpuser/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
Password:
debug1: Authentication succeeded (keyboard-interactive)
debug1: channel 0: new [client-session]
debug1: send channel open 0
debug1: Entering interactive session.
debug1: ssh_session2_setup: id 0
debug1: channel request 0: pty-req
debug1: channel request 0: shell
debug1: fd 4 setting TCP_NODELAY
debug1: channel 0: open confirm rwindow 0 rmax 32768
Last login: Fri Nov 6 10:14:07 2009 from 10.2.150.209
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
-bash-3.00$



в sun-доке еще написано про ssh-agent, но что с ним, что без него не получается, есть мнения, почему?
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36293947
fabler
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
дополню, что на соседний серврер с ubunty доступ работает корректно...
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36294259
Learning_Oracle
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
PubkeyAuthentication yes
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36294275
Learning_Oracle
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
IdentityFile ~/.ssh/authorized_keys

и так наверное под ключи...
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36294557
chmod 0755 ~/.ssh
chmod 0644 ~/.ssh/authorized_keys

Ну и проверить что никакой идиот не поставил ssh.com вместо штатного на этот соларез.
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36294648
Learning_Oracle
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
майор скрытность

Ну и проверить что никакой идиот не поставил ssh.com вместо штатного на этот соларез.

#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)sshd_config 1.8 04/05/10 SMI"

майор, это не показатель ???
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36295089
это ничего не значит, поскольку ssh.com кладёт свои конфиги в /etc/ssh2 :)
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36295124
Learning_Oracle
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
майор скрытностьэто ничего не значит, поскольку ssh.com кладёт свои конфиги в /etc/ssh2 :)

хорошо, возможно и кладёт...
продукт называется "SSH Tectia Client/Server"

в системе врядли он будет виден как sshd....или я ошибаюсь...?
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36295289
fabler
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
PubkeyAuthentication yes не помог (он в yes по умолчанию),
значение параметра IdentityFile ~/.ssh/authorized_keys для версии ssh 1, у меня v 2...
chmod 0755 ~/.ssh
chmod 0644 ~/.ssh/authorized_keys
не помогает...

я не понимаю, почему в дебаг моде сервер пишет:
debug1: Next authentication method: publickey
debug1: Trying private key: /export/home/ftpuser/.ssh/identity
debug1: Trying public key: /export/home/ftpuser/.ssh/id_rsa
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36295320
Learning_Oracle
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
fabler,


может надо Pam_sshd смотреть?
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36295326
Learning_Oracle
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
в частности секцию "auth"
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36295338
Learning_Oracle
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Learning_Oracle,

UsePAM yes

у меня на rpm-base Linux
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36295383
fabler
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
параметра UsePAM нет, если я правильно читаю доку...
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36298377
fabler
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
все еще актуально
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36302485
fabler
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
если в конф. файл добавить строку
Код: plaintext
IdentityFile   ~/.ssh/id_rsa

то ssh вообще не стартует со следующей ошибкой (/var/svc/log/network-ssh:default.log):

Код: plaintext
1.
2.
3.
[ Nov 10 22:23:26 Executing start method ("/lib/svc/method/sshd start") ]
/etc/ssh/sshd_config: line 164: Bad configuration option: IdentityFile
/etc/ssh/sshd_config: terminating, 1 bad configuration options
[ Nov 10 22:23:26 Method "start" exited with status 255 ]
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36305193
Фотография andrey_anonymous
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
oracle@pooh$ uname -a
SunOS pooh.msk.mt  5 . 10  Generic_137137- 09  sun4u sparc SUNW,Sun-Fire Solaris

oracle@pooh$ id
uid= 200 (oracle) gid= 200 (oinstall) groups= 200 (oinstall), 205 (dba)

oracle@pooh$ ssh winnie
Last login: Wed Nov  11   21 : 09 : 35   2009  from pooh.msk.mt
Sun Microsystems Inc.   SunOS  5 . 10       Generic January  2005 

oracle@winnie$ id
uid= 200 (oracle) gid= 200 (oinstall) groups= 200 (oinstall), 205 (dba)

oracle@winnie$
Что Вам рассказать?
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36306158
fabler
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
andrey_anonymous,

-bash-3.00$ uname -a
SunOS isystem 5.10 Generic_139556-08 i86pc i386 i86pc
-bash-3.00$ id
uid=1111(ftpuser) gid=1(other)
-bash-3.00$ ssh Server
Password:
Last login: Thu Nov 12 11:26:56 2009 from Client
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
-bash-3.00$ id
uid=2001(ftpuser) gid=301(ftpusers)
-bash-3.00$
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36307367
Фотография andrey_anonymous
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
fablerandrey_anonymous,
Я спрашивал - что Вам рассказать о беспарольном ssh :)
Делал давно уже, подробности немного стерлись из памяти.
Один момент точно отличается - у меня сгенерированы и разложены в authorized_keys оба вида ключей.
Не помню почему, но под oracle кластерварь надо было так.
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36307383
fabler
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
andrey_anonymous,

я тоже не понял тайный смысл запрошенной информации, но мало ли :)
оба вида ключей - dsa и rsa или что?

если не сложно, приведите, пожалуйста, настройки sshd_config обоих серверов?
мне кажетсЯ, что дело в них...
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36307397
Фотография andrey_anonymous
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
fabler, да, rsa+dsa.
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
oracle@pooh$ egrep -v '(^#|^$)' /etc/ssh/sshd_config
Protocol  2 
Port  22 
ListenAddress ::
AllowTcpForwarding no
GatewayPorts no
X11Forwarding yes
X11DisplayOffset  10 
X11UseLocalhost yes
PrintMotd no
KeepAlive yes
SyslogFacility auth
LogLevel info
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
ServerKeyBits  768 
KeyRegenerationInterval  3600 
StrictModes yes
LoginGraceTime  600 
MaxAuthTries     6 
MaxAuthTriesLog  3 
PermitEmptyPasswords no
PasswordAuthentication yes
PAMAuthenticationViaKBDInt yes
PermitRootLogin no
Subsystem       sftp    /usr/lib/ssh/sftp-server
IgnoreRhosts yes
RhostsAuthentication no
RhostsRSAAuthentication no
RSAAuthentication yes

oracle@pooh$ ssh winnie
Last login: Thu Nov  12   17 : 02 : 49   2009  from pooh.msk.mt
Sun Microsystems Inc.   SunOS  5 . 10       Generic January  2005 

oracle@winnie$ egrep -v '(^#|^$)' /etc/ssh/sshd_config
Protocol  2 
Port  22 
ListenAddress ::
AllowTcpForwarding no
GatewayPorts no
X11Forwarding yes
X11DisplayOffset  10 
X11UseLocalhost yes
PrintMotd no
KeepAlive yes
SyslogFacility auth
LogLevel info
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
ServerKeyBits  768 
KeyRegenerationInterval  3600 
StrictModes yes
LoginGraceTime  600 
MaxAuthTries     6 
MaxAuthTriesLog  3 
PermitEmptyPasswords no
PasswordAuthentication yes
PAMAuthenticationViaKBDInt yes
PermitRootLogin yes
Subsystem       sftp    /usr/lib/ssh/sftp-server
IgnoreRhosts yes
RhostsAuthentication no
RhostsRSAAuthentication no
RSAAuthentication yes

oracle@winnie$

...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36307486
Фотография andrey_anonymous
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Собственно, разница в конфиге только одна - у меня нет строчки
Код: plaintext
IdentityFile ~/.ssh/id_rsa
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36307710
Learning_Oracle
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
andrey_anonymous ,
а где же вы храните ключики тогда?
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36307775
Фотография andrey_anonymous
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Learning_Oracleandrey_anonymous ,
а где же вы храните ключики тогда?
Код: plaintext
~/.ssh
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36308118
Learning_Oracle
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
а в конфиге?
...
Рейтинг: 0 / 0
беспарольный ssh между серверами Solaris 10
    #36309188
Фотография andrey_anonymous
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Learning_Oracleа в конфиге?
В каком?
/etc/ssh/ssh_config - пустой, ~/.ssh/config отсутствует, /etc/ssh/sshd_config - четырьмя постами выше.
...
Рейтинг: 0 / 0
25 сообщений из 37, страница 1 из 2
Форумы / Unix-системы [игнор отключен] [закрыт для гостей] / беспарольный ssh между серверами Solaris 10
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]