Portál AbcLinuxu, 11. května 2025 01:06
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003 debug1: Reading configuration data /root/.ssh/config debug1: Applying options for localhost debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to localhost [127.0.0.1] port 22222. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug3: Not a RSA1 key file /root/.ssh/id_rsa. debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug2: key_type_from_name: unknown key type '-----END' debug3: key_read: missing keytype debug1: identity file /root/.ssh/id_rsa type 1 debug3: Not a RSA1 key file /root/.ssh/id_rsa. debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug2: key_type_from_name: unknown key type '-----END' debug3: key_read: missing keytype debug1: identity file /root/.ssh/id_rsa type 1 debug1: Remote protocol version 1.99, remote software version OpenSSH_3.9p1 debug1: match: OpenSSH_3.9p1 pat OpenSSH* debug1: Local version string SSH-1.5-OpenSSH_3.9p1 debug2: fd 3 setting O_NONBLOCK debug1: Waiting for server public key. debug1: Received server public key (768 bits) and host key (1024 bits). debug3: check_host_in_hostfile: filename /root/.ssh/known_hosts debug3: check_host_in_hostfile: match line 3 debug1: Host 'localhost' is known and matches the RSA1 host key. debug1: Found key in /root/.ssh/known_hosts:3 debug1: Encryption type: 3des debug1: Sent encrypted session key. debug2: cipher_init: set keylen (16 -> 32) debug2: cipher_init: set keylen (16 -> 32) debug1: Installing crc compensation attack detector. debug1: Received encrypted confirmation. Permission denied.Podle toho výpisu mi připadá, jako by byl špatný formát mého soukromého klíče (podle toho Not a RSA1 key file /root/.ssh/id_rsa). Co dělám špatně?? Díky
$ man ssh-keygen (...) ssh-keygen can create RSA keys for use by SSH protocol version 1 and RSA or DSA keys for use by SSH protocol version 2. The type of key to be generated is specified with the -t option. (...) -t type Specifies the type of the key to create. The possible values are "rsa1" for protocol version 1 and "rsa" or "dsa" for proto- col version 2.Takže buď použít ssh v2 (doporučuju), nebo, pokud skutečně potřebujete starou verzi protokolu, vygenerujte nový klíč pomocí
$ ssh-keygen -t rsa1
hafi@debian:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hafi/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/hafi/.ssh/id_rsa.
Your public key has been saved in /home/hafi/.ssh/id_rsa.pub.
The key fingerprint is:
ff:94:24:22:c8:f0:ce:77:a6:ed:35:a8:0d:84:53:1f hafi@debian
V ~/.ssh se nám vytvoří privátní klíč id_rsa a veřejný klíč id_rsa.pub
Veřejný klíč bezpečně dopravíme na cílový stroj
scp -P2233 ~/.ssh/id_rsa.pub user@remote.machine:/home/user/.ssh/temp
cd /home/hafi/.ssh
cat temp >> authorized_keys
rm temp
Aby bylo přihlašování funkční je nutné mít práva u souboru authorized_keys nastavena jen pro čtení vlastníkem.
Not a RSA1 key file /root/.ssh/id_dsa. On nepozná, že se jedná o DSA klíč? Musím to zadat nějakým parametrem?
ssh -1 adresatak se spolehlive prihlasim bez zadani hesla a vsechno jde OK. Ale nejde mi to pred scp. Kdyz pouziju prikaz
scp zdrojovy_soubor uzivatel@adresa:cilovy_soubortak mi to napise
Permission denied (publickey,gssapi-with-mic,password).Prosim poraďte
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.