PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : nochmal sshd_config und AllowUser root



moxxer
26.07.05, 11:14
Hi,

ich hab auf meheren SSH-Servern testweise in die sshd_config eingetragen
"AllowUsers root@mydomain.de".
Also root darf nur von bestimmten Host aus connecten.

Auf einigen SSH-Servern klappt das und bei anderen nicht.
/var/log/messages meint dann im Fehlerfall "User root not allowed because not listed in AllowUsers".

Es nützt auch nichts, an PermitRootLogin rumzuschrauben, er lässt da, wo es nicht funzt,
alle root's egal von wo durch oder gar keinen.

Ist das versionsabhängig oder was kann das sein ?

Grüsse

syn
26.07.05, 11:25
Hi!

Versuchs mal mit


ssh -v root@host
und poste dann die Fehlermeldung.


Hier ein Auszug aus der ssh-manpage.


-v Verbose mode. Causes ssh to print debugging messages about its
progress. This is helpful in debugging connection, authentica-
tion, and configuration problems. Multiple -v options increase
the verbosity. The maximum is 3.


Gruß

moxxer
26.07.05, 20:38
Hi,

hier das Listing von "ssh -v":

OpenSSH_3.4p1 Debian 1:3.4p1-1.woody.3, SSH protocols 1.5/2.0, OpenSSL 0x0090603f
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 84.190.15.8 port 222.
debug1: Connection established.
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.7.1p2
debug1: match: OpenSSH_3.7.1p2 pat OpenSSH*
Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.4p1 Debian 1:3.4p1-1.woody.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: dh_gen_key: priv key bits set: 130/256
debug1: bits set: 1572/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
Warning: Permanently added '84.190.15.8' (RSA) to the list of known hosts.
debug1: bits set: 1567/3191
debug1: ssh_rsa_verify: signature correct
debug1: kex_derive_keys
debug1: newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: waiting for SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: service_accept: ssh-userauth
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: authentications that can continue: publickey,keyboard-interactive
debug1: next auth method to try is publickey
debug1: try privkey: /root/.ssh/identity
debug1: try privkey: /root/.ssh/id_rsa
debug1: try privkey: /root/.ssh/id_dsa
debug1: next auth method to try is keyboard-interactive
debug1: authentications that can continue: publickey,keyboard-interactive
debug1: authentications that can continue: publickey,keyboard-interactive
debug1: authentications that can continue: publickey,keyboard-interactive
debug1: no more auth methods to try
Permission denied (publickey,keyboard-interactive).
debug1: Calling cleanup 0x8063aac(0x0)

Jasper
26.07.05, 20:48
Ist das versionsabhängig oder was kann das sein ?


dein reverse-lookup funktioniert nicht, d.h. sshd löst die ip-adresse rückwärts auf und der aufgelöste hostname passt nicht zum allowuser-eintrag.


-j

moxxer
27.07.05, 13:27
# vielen Dank, das war's :-)

Lord Cybertrack
03.03.06, 22:48
Hallo, hab da ein Ähnliches Problem.
Hab alles Kontrolliert und Stimmt auch alles.
Also ssh_config
kommt aber immer:

OpenSSH_3.9p1, OpenSSL 0.9.7e 25 Oct 2004
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 85.25.130.19 [85.25.130.19] port 22.
debug1: Connection established.
debug1: identity file /srv/www/web1/.ssh/identity type -1
debug1: identity file /srv/www/web1/.ssh/id_rsa type 1
debug1: identity file /srv/www/web1/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.9p1
debug1: match: OpenSSH_3.9p1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.9p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '85.25.130.19' is known and matches the RSA host key.
debug1: Found key in /srv/www/web1/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /srv/www/web1/.ssh/identity
debug1: Offering public key: /srv/www/web1/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Trying private key: /srv/www/web1/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
Währe klasse wen Ihr da auch helfen könntet.

marce
04.03.06, 10:12
aha. Und wie äussert sich das Problem konkret?

Lord Cybertrack
04.03.06, 11:11
Das er nicht per Publickkey reingeht sondern immer passwort haben will.

MiGo
04.03.06, 12:12
Hast du ihm den public-key deines Benutzers in die authorized_keys geschrieben?
Nach debug1: Offering public key: /srv/www/web1/.ssh/id_rsa sollte eigentlich
debug1: Server accepts key: pkalg ssh-rsa blen 149
kommen (oder so ähnlich).

Jasper
04.03.06, 12:29
Das er nicht per Publickkey reingeht sondern immer passwort haben will.

starte den server mal mit '-D -d' und sieh dir den debugoutput des servers an. am besten noch einen anderen port verwenden ('-p 2200'), so sägt man sich bei remote hosts nicht selbst ab.

-j

Lord Cybertrack
04.03.06, 17:34
starte den server mal mit '-D -d' und sieh dir den debugoutput des servers an. am besten noch einen anderen port verwenden ('-p 2200'), so sägt man sich bei remote hosts nicht selbst ab.

-j

web1@vs161043:~/.ssh> ssh -v web1@85.25.130.19
OpenSSH_3.9p1, OpenSSL 0.9.7e 25 Oct 2004
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 85.25.130.19 [85.25.130.19] port 22.
debug1: Connection established.
debug1: identity file /srv/www/web1/.ssh/identity type -1
debug1: identity file /srv/www/web1/.ssh/id_rsa type 1
debug1: identity file /srv/www/web1/.ssh/id_dsa type 2
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.9p1
debug1: match: OpenSSH_3.9p1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.9p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '85.25.130.19' is known and matches the RSA host key.
debug1: Found key in /srv/www/web1/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /srv/www/web1/.ssh/identity
debug1: Offering public key: /srv/www/web1/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering public key: /srv/www/web1/.ssh/id_dsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
Password:

Welchen wie meinst du das???Habe gerade mit DSA probiert ebenfalls will er das passwort.

Lord Cybertrack
04.03.06, 18:12
Hab den Server schon 3X neu Installieren lassen. Und das sollte Morgen laufen bin echt am abdrehen HILFE

Jasper
04.03.06, 21:33
du sollst den server mit debug starten, nicht den client:

# /usr/sbin/sshd -d -D -p 2200
debug1: sshd version OpenSSH_3.6.1p2
debug1: private host key: #0 type 0 RSA1
debug1: read PEM private key done: type RSA
debug1: private host key: #1 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #2 type 2 DSA
socket: Address family not supported by protocol
debug1: Bind to port 2200 on 0.0.0.0.
Server listening on 0.0.0.0 port 2200.
Generating 768 bit RSA key.
RSA key generation complete.
debug1: Server will not fork when running in debugging mode.
...


-j

Lord Cybertrack
04.03.06, 21:48
Hallo,
Welchen Server meinst du den wo ich asugehe oder wo ich drauf will.
Habe 3 Server auf dem
ALso
Vserver -> Root1 funktioniert
Vserver -> Root2

VVServer zu root 1 HAt mir Kollege an den ich leider nichtmehr rankomme eingerichtet da gerht es
User auf dem VServer ist Web1

Muß das jetzt vServer -> Root 2 einrichten und das will nicht.
Also sshd -d -D -p 2200 auf dem VServer oder Root2???

Jasper
05.03.06, 09:25
das ist doch nicht so schwer. du verbindest dirch per ssh zu 85.25.139.19:

web1@vs161043:~/.ssh> ssh -v web1@85.25.130.19
OpenSSH_3.9p1, OpenSSL 0.9.7e 25 Oct 2004
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 85.25.130.19 [85.25.130.19] port 22.
debug1: Connection established.

also musst du den auf dieser ip lauschenden sshd mit debug und auf einem anderen port starten um zu sehen, warum der sshd den angebotenen key nicht will. häufigste ursache sind zu laxe permissions von $HOME/.ssh.


-j