Hence, I installed on it
openssh-server
. On the other laptop I generated a public SSH-key and successfully copied it in the "server". Then, on the server, I disabled password authentication and reloaded and restarted the ssh daemon through sudo systemctl restart ssh && sudo systemctl reload ssh
... however the authentication phase still prompts the password!I also rebooted the laptop and added some other prohibitions in the
/etc/ssh/ssh_config
file because I found online some guides that state that just disabling password authentication is not enough.Finally, the key based authentication still does not work, the authentication still prompts the password, and here it is how the
/etc/ssh/ssh_config
file looks now:
Code: Select all
1 │
2 │ # This is the ssh client system-wide configuration file. See
3 │ # ssh_config(5) for more information. This file provides defaults for
4 │ # users, and the values can be changed in per-user configuration files
5 │ # or on the command line.
6 │
7 │ # Configuration data is parsed as follows:
8 │ # 1. command line options
9 │ # 2. user-specific file
10 │ # 3. system-wide file
11 │ # Any configuration value is only changed the first time it is set.
12 │ # Thus, host-specific definitions should be at the beginning of the
13 │ # configuration file, and defaults at the end.
14 │
15 │ # Site-wide defaults for some commonly used options. For a comprehensive
16 │ # list of available options, their meanings and defaults, please see the
17 │ # ssh_config(5) man page.
18 │
19 │ Include /etc/ssh/ssh_config.d/*.conf
20 │
21 │ Host *
22 │ # ForwardAgent no
23 │ # ForwardX11 no
24 │ # ForwardX11Trusted yes
25 │ PasswordAuthentication no
26 │ ChallengeResponseAuthentication no
27 │ UsePAM no
28 │ PermitRootLogin prohibit-password # also tried "no"
29 │ # HostbasedAuthentication no
30 │ # GSSAPIAuthentication no
31 │ # GSSAPIDelegateCredentials no
32 │ # GSSAPIKeyExchange no
33 │ # GSSAPITrustDNS no
34 │ # BatchMode no
35 │ # CheckHostIP yes
36 │ # AddressFamily any
37 │ # ConnectTimeout 0
38 │ # StrictHostKeyChecking ask
39 │ # IdentityFile ~/.ssh/id_rsa
40 │ # IdentityFile ~/.ssh/id_dsa
41 │ # IdentityFile ~/.ssh/id_ecdsa
42 │ # IdentityFile ~/.ssh/id_ed25519
43 │ # Port 22
44 │ # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
45 │ # MACs hmac-md5,hmac-sha1,umac-64@openssh.com
46 │ # EscapeChar ~
47 │ # Tunnel no
48 │ # TunnelDevice any:any
49 │ # PermitLocalCommand no
50 │ # VisualHostKey no
51 │ # ProxyCommand ssh -q -W %h:%p gateway.example.com
52 │ # RekeyLimit 1G 1h
53 │ # UserKnownHostsFile ~/.ssh/known_hosts.d/%k
54 │ SendEnv LANG LC_*
55 │ HashKnownHosts yes
56 │ GSSAPIAuthentication yes