Sie sind nicht angemeldet.

1

05.01.2016, 10:43

SSH nimmt keyfiles nicht an

Hi zusammen,
ich versuche gerade mein RaspberryPi so einzurichten, das ich mich über SSH ohne Passwort einloggen kann.

Dazu habe ich folgende Befehle ausgeführt:
Client:

Quellcode

1
2
$ssh-keygen -t rsa
$scp .ssh/akoya-linux_siggi_nopasswd.pub kodi@kodi:~/.ssh/


Bei der Abfrage nach dem Dateinahmen habe ich §akoya-linux_siggi_nopasswd" gewählt um den Schlüßel zuordnen zu können.
Bei der Abfrage nach dem Passwort hab ich einfach "ENTER" gedrückt.

Raspberry:

Quellcode

1
2
3
4
$cat akoya-linux_siggi_nopasswd.pub >> authorized_keys
$su
$nano /etc/ssh/sshd_config
$/etc/init.d/ssh restart


In der "sshd_config" habe ich folgendes geändert:

Quellcode

1
2
RSAAuthentication yes
PubkeyAuthentication yes


Versuche ich mich nun einzuloggen wird trotzdem nach einen Passwort gefragt

Quellcode

1
ssh -i .ssh/akoya-linux_siggi_nopasswd kodi@kodi


DEBUG-Ausgabe auf dem Client:

Quellcode

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
debug2: key: akoya-linux_siggi_nopasswd (0x561c2ea52ee0), explicit
debug2: key: siggi@akoya-linux (0x561c2ea61e40),
debug1: Authentications that can continue: publickey,keyboard-interactive
debug3: start over, passed a different list publickey,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: akoya-linux_siggi_nopasswd
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp SHA256:HLRoGUn1Y8vP14fsOPkz98STkyZjRZUdbautXdaqLn4
debug3: sign_and_send_pubkey: RSA SHA256:HLRoGUn1Y8vP14fsOPkz98STkyZjRZUdbautXdaqLn4
debug1: Offering RSA public key: siggi@akoya-linux
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,keyboard-interactive
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:


DEBUG-Ausgabe Raspberry:

Quellcode

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
Jan  5 10:36:55 kodi sshd[32114]: debug1: Forked child 1956.
Jan  5 10:36:55 kodi sshd[1956]: debug1: Set /proc/self/oom_score_adj to 0
Jan  5 10:36:55 kodi sshd[1956]: debug1: rexec start in 4 out 4 newsock 4 pipe 6 sock 7
Jan  5 10:36:55 kodi sshd[1956]: debug1: inetd sockets after dupping: 3, 3
Jan  5 10:36:55 kodi sshd[1956]: Connection from 192.168.0.104 port 46210 on 192.168.0.110 port 22
Jan  5 10:36:55 kodi sshd[1956]: debug1: HPN Disabled: 0, HPN Buffer Size: 87380
Jan  5 10:36:55 kodi sshd[1956]: debug1: Client protocol version 2.0; client software version OpenSSH_7.1p1-hpn14v9
Jan  5 10:36:55 kodi sshd[1956]: debug1: match: OpenSSH_7.1p1-hpn14v9 pat OpenSSH* compat 0x04000000
Jan  5 10:36:55 kodi sshd[1956]: debug1: Enabling compatibility mode for protocol 2.0
Jan  5 10:36:55 kodi sshd[1956]: debug1: Local version string SSH-2.0-OpenSSH_7.1p1-hpn14v9
Jan  5 10:36:55 kodi sshd[1956]: debug1: permanently_set_uid: 22/22 [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: ssh_sandbox_child: prctl(PR_SET_SECCOMP): Invalid argument [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: list_hostkey_types: ssh-rsa,ssh-ed25519 [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: SSH2_MSG_KEXINIT sent [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: SSH2_MSG_KEXINIT received [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: AUTH STATE IS 0 [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: REQUESTED ENC.NAME is 'chacha20-poly1305@openssh.com' [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: REQUESTED ENC.NAME is 'chacha20-poly1305@openssh.com' [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: SSH2_MSG_NEWKEYS sent [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: expecting SSH2_MSG_NEWKEYS [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: SSH2_MSG_NEWKEYS received [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: KEX done [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: userauth-request for user kodi service ssh-connection method none [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: attempt 0 failures 0 [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: Config token is loglevel
Jan  5 10:36:55 kodi sshd[1956]: debug1: Config token is rsaauthentication
Jan  5 10:36:55 kodi sshd[1956]: debug1: Config token is pubkeyauthentication
Jan  5 10:36:55 kodi sshd[1956]: debug1: Config token is authorizedkeysfile
Jan  5 10:36:55 kodi sshd[1956]: debug1: Config token is passwordauthentication
Jan  5 10:36:55 kodi sshd[1956]: debug1: Config token is usepam
Jan  5 10:36:55 kodi sshd[1956]: debug1: Config token is printmotd
Jan  5 10:36:55 kodi sshd[1956]: debug1: Config token is printlastlog
Jan  5 10:36:55 kodi sshd[1956]: debug1: Config token is useprivilegeseparation
Jan  5 10:36:55 kodi sshd[1956]: debug1: Config token is subsystem
Jan  5 10:36:55 kodi sshd[1956]: debug1: Config token is acceptenv
Jan  5 10:36:55 kodi sshd[1956]: debug1: PAM: initializing for "kodi"
Jan  5 10:36:55 kodi sshd[1956]: debug1: PAM: setting PAM_RHOST to "192.168.0.104"
Jan  5 10:36:55 kodi sshd[1956]: debug1: PAM: setting PAM_TTY to "ssh"
Jan  5 10:36:55 kodi sshd[1956]: debug1: userauth-request for user kodi service ssh-connection method publickey [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: attempt 1 failures 0 [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: test whether pkalg/pkblob are acceptable [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: temporarily_use_uid: 1000/1000 (e=0/0)
Jan  5 10:36:55 kodi sshd[1956]: debug1: trying public key file /home/kodi/.ssh/authorized_keys
Jan  5 10:36:55 kodi sshd[1956]: debug1: fd 4 clearing O_NONBLOCK
Jan  5 10:36:55 kodi sshd[1956]: debug1: matching key found: file /home/kodi/.ssh/authorized_keys, line 2 RSA SHA256:HLRoGUn1Y8vP14fsOPkz98STkyZjRZUdbautXdaqLn4
Jan  5 10:36:55 kodi sshd[1956]: debug1: restore_uid: 0/0
Jan  5 10:36:55 kodi sshd[1956]: Postponed publickey for kodi from 192.168.0.104 port 46210 ssh2 [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: userauth-request for user kodi service ssh-connection method publickey [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: attempt 2 failures 0 [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: test whether pkalg/pkblob are acceptable [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: temporarily_use_uid: 1000/1000 (e=0/0)
Jan  5 10:36:55 kodi sshd[1956]: debug1: trying public key file /home/kodi/.ssh/authorized_keys
Jan  5 10:36:55 kodi sshd[1956]: debug1: fd 4 clearing O_NONBLOCK
Jan  5 10:36:55 kodi sshd[1956]: debug1: restore_uid: 0/0
Jan  5 10:36:55 kodi sshd[1956]: Failed publickey for kodi from 192.168.0.104 port 46210 ssh2: RSA SHA256:j26AZYMEDIPXO/Ykm2tkouRICI2teJMYTNmcTToIkL4
Jan  5 10:36:55 kodi sshd[1956]: debug1: userauth-request for user kodi service ssh-connection method keyboard-interactive [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: attempt 3 failures 1 [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: keyboard-interactive devs  [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: auth2_challenge: user=kodi devs= [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: kbdint_alloc: devices 'pam' [preauth]
Jan  5 10:36:55 kodi sshd[1956]: debug1: auth2_challenge_start: trying authentication method 'pam' [preauth]
Jan  5 10:36:55 kodi sshd[1956]: Postponed keyboard-interactive for kodi from 192.168.0.104 port 46210 ssh2 [preauth]


Ich hoffe ihr könnt ihr bei meinem Problem helfen.

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »dsiggi« (05.01.2016, 11:08)


2

05.01.2016, 10:54

Hab das Problem gelöst.
Anscheinend ist der Dateiname "akoya-linux_siggi_nopasswd" zu lange.
Hab das Keyfile umbenannt nach "siggi-nopasswd" und schon klappt es.

dsiggi

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »dsiggi« (05.01.2016, 11:09)