Vérifie que ta clé publique a bien été copiée sur le serveur en examinant le fichier ~/.ssh/authorized_keys dans le dossier personnel de l'utilisateur sur le serveur.
Oui oui, comme indiqué dans mon PS.
ssh -p 0000 -v XXX@YYY
OpenSSH_7.6p1 Ubuntu-4ubuntu0.2, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to YYY [000.000.000.000] port 0000.
debug1: Connection established.
debug1: identity file /home/hizoka/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /home/hizoka/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/hizoka/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/hizoka/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/hizoka/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/hizoka/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/hizoka/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/hizoka/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.2
debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to YYY:0000 as 'XXX'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:xcH5rkLGy6KLtFMGA3Jk9WdQwfuV0/PaTW/HQ4B9W0I
debug1: Host '[YYY]:0000' is known and matches the ECDSA host key.
debug1: Found key in /home/hizoka/.ssh/known_hosts:13
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:pGCJZJPEBAOs5ZkdviJRlfaul60/vxyk/DpGhy7ERmk /home/hizoka/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/hizoka/.ssh/id_dsa
debug1: Trying private key: /home/hizoka/.ssh/id_ecdsa
debug1: Trying private key: /home/hizoka/.ssh/id_ed25519
debug1: Next authentication method: password
XXX@YYY's password:
debug1: Authentication succeeded (password).
Authenticated to YYY ([000.000.000.000]:0000).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
J'ai viré tout le code commenté, si besoin je peux le remettre
cat /etc/ssh/sshd_config
# $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
Port 0000
PermitRootLogin without-password
PasswordAuthentication yes
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
PrintLastLog no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
# Blocage de l’accès à la console SSH
Match User AAA
ForceCommand internal-sftp
ChrootDirectory /home/AAA
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no
# Blocage de l’accès à la console SSH
Match User BBB
ForceCommand internal-sftp
ChrootDirectory /home/BBB
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no
Si je comprends bien ce que tu essaies de faire, quelqu'un qui te vole ton ordinateur aura aussi un accès au serveur hmm
1) Il faudrait déjà que le voleur le sache...
2) Cet utilisateur ne peut rien faire sur le serveur
3) L'idée finale est de bloquer la connexion ssh pour ne laisser que le sftp