Soit deux ordinateurs sous Fedora:
192.168.1.10 serveur
192.168.1.11 client
Sur le serveur:
Vérifier que le port pour ssh est ouvert au niveau de firewalld
$ sudo firewall-cmd --list-all
FedoraWorkstation (active)
target: default
icmp-block-inversion: no
interfaces: enp3s0
sources:
services: dhcpv6-client mdns samba-client ssh
ports: 1025-65535/udp 1025-65535/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
Démarrer le service sshd:
$ sudo systemctl start sshd.service
Si nécessaire mettre le service sshd en démarrage automatique
$ sudo systemctl enable sshd.service
Vérifier le status du service sshd
$ sudo systemctl status sshd.service
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset>
Active: active (running) since Thu 2019-08-29 09:21:47 CEST; 11min ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 1174 (sshd)
Tasks: 1 (limit: 4915)
Memory: 2.5M
CGroup: /system.slice/sshd.service
└─1174 /usr/sbin/sshd -D -oCiphers=aes256-gcm@openssh.com,chacha20-p>
août 29 09:21:47 desktop.home systemd[1]: Starting OpenSSH server daemon...
août 29 09:21:47 desktop.home sshd[1174]: Server listening on 0.0.0.0 port 22.
août 29 09:21:47 desktop.home sshd[1174]: Server listening on :: port 22.
août 29 09:21:47 desktop.home systemd[1]: Started OpenSSH server daemon.
Sur le client:
Si tu utilises le même nom d'utilisateur sur client et serveur:
$ ssh 192.168.1.10
The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
ECDSA key fingerprint is SHA256:6s+azertyuiopMVgD5u+FixE/7YkQxazertyuiop.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
yes
user@192.168.1.10's password:
Last login: Thu Aug 29 09:42:37 2019 from 192.168.1.11
Si tu utilises des noms d'utilisateur différents sur client et serveur tu dois préciser dans ta commande sur le client l'utilisateur sur le serveur:
$ ssh user_svr@192.168.1.10
The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
ECDSA key fingerprint is SHA256:6s+azertyuiopMVgD5u+FixE/7YkQxazertyuiop.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
yes
user_svr@192.168.1.10's password:
Last login: Thu Aug 29 09:42:37 2019 from 192.168.1.11
Les messages suivant n'étant affichés qu'à la première connexion:
The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
ECDSA key fingerprint is SHA256:6s+azertyuiopMVgD5u+FixE/7YkQxazertyuiop.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
yes