Portál AbcLinuxu, 13. května 2025 20:23
~/.ssh
adresář a 600 na ~/.ssh/id_rsa
(privátní klíč). Pokud nepomůže, zkus volat ssh klienta s vobou -v (verbose mode) a pošli výstup.
[progdan@notas .ssh]$ ssh -p 9701 tioh -l progdan -v OpenSSH_5.1p1, OpenSSL 0.9.8i 15 Sep 2008 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to tioh [192.168.1.100] port 9701. debug1: Connection established. debug1: identity file /home/progdan/.ssh/id_rsa type 1 debug1: identity file /home/progdan/.ssh/id_dsa type 2 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1 debug1: match: OpenSSH_5.1 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.1 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 '[tioh]:9701' is known and matches the RSA host key. debug1: Found key in /home/progdan/.ssh/known_hosts:1 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,password debug1: Next authentication method: publickey debug1: Offering public key: /home/progdan/.ssh/id_rsa debug1: Authentications that can continue: publickey,password debug1: Offering public key: /home/progdan/.ssh/id_dsa debug1: Authentications that can continue: publickey,password debug1: Next authentication method: password progdan@tioh's password: debug1: Authentication succeeded (password). debug1: channel 0: new [client-session] debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug1: Requesting X11 forwarding with authentication spoofing. Last login: Wed Oct 1 23:05:57 2008 from 192.168.1.101 Welcome to MATRIX [progdan@TIOH ~]$
PermitEmptyPasswords yes
no
a přihlášení klíčem bez problému funguje.
PermitEmptyPasswords When password authentication is allowed, it specifies whether the server allows login to accounts with empty password strings. The default is ``no''.No tak to nehrozi. Sice tam zadne uzivatele s prazdnym heslem uz nemam, ale nahoda je blbec.
/etc/ssh/sshd_config
volba PubkeyAuthentication yes
. Pak bych zkusil na serveru vrazit veřejný klíč do ~/.ssh/authorized_keys
(místo do~/.ssh/authorized_keys2
). Nakonec, máte-li na serveru roota (nebo je-li se správcem rozumná řeč), zkusit spustit sshd
v debugovacím módu (man sshd
) a podívat se, jestli nevyhodí nějaký rozumný výstup.
PubkeyAthentication
je povolena.
Zkousel jsem authorized_keys
, authorized_keys2
i identity
.
sshd
. Bez ohledu na to, jak moc (nebo málo) blbá je ta chyba, kterou tam máte, se IMO těžko pohnete, dokud nebudete vědět, co na ty vaše pokusy říká server.
U klienta jsem vydegeneroval DSA klic, na serveru jsem ho vrazil do ~/.ssh/authorized_keys2Muzete to vice rozepsat?
ssh-keygen -t dsaA vygenerovany .ssh/id_rsa.pub sem prenesl na server do .ssh/authorized_keys
Passphrase sem zadal prazdnounezadal
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub | ssh uzivatel@serever "cat >> .ssh/authorized_keys"
$ ssh user@server -v
OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to X.X.X.X [X.X.X.X] port 22.
debug1: Connection established.
debug1: identity file /home/chocholj/.ssh/identity type -1
debug1: identity file /home/chocholj/.ssh/id_rsa type 1
debug1: identity file /home/chocholj/.ssh/id_dsa type 2
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.9p1
debug1: match: OpenSSH_3.9p1 pat OpenSSH_3.*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.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(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 'X.X.X.X' is known and matches the RSA host key.
debug1: Found key in /home/chocholj/.ssh/known_hosts:90
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,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/chocholj/.ssh/identity
debug1: Offering public key: /home/chocholj/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LC_PAPER = cs_CZ
debug1: Sending env LC_MONETARY = cs_CZ
debug1: Sending env LC_COLLATE = cs_CZ
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_CTYPE = cs_CZ
Last login: Thu Oct 2 10:42:23 2008 from Y.Y.Y.Y
#
Dulezite jsou ty tucne radky
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.