Oui, désolé.
Alors, j'aimerai avoir des utilisateurs unix (accès SSH, si ils sont listés dans AllowUsers) et accès SFTP (en confinant les utilisateurs dans leur répertoire respectif).
J'ai apporté ces modifications au fichier « sshd_config » :
Subsystem sftp internal-sftp
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM yes
Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes128-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160
KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
Match Group sftpusers
ChrootDirectory /home/%u
ForceCommand internal-sftp
AllowTcpForwarding no
PermitTunnel no
X11Forwarding no
Le soucis est que si l'utilisateur « user01 » est dans le groupe « sftpusers » (permettant ainsi la connexion SFTP et le bloquer dans son répertoire), j'ai le fonctionnement souhaité lorsque je test avec WinSCP ou Filezilla, mais par contre, je ne peux plus me connecter en SSH (console). D'après ce que j'ai lu, ceci est normal.
Mais j'aimerai justement qu'un utilisateur puisse aussi bien se connecter en SFTP (tout en l'empêcher d'aller ailleurs que le répertoire personnelle) + connexion SSH (terminal) si l'utilisateur est bien renseigné dans « AllowUsers ».
Suis-je obligé d'avoir un fonctionnement du genre : « user01 » (SSH) et « user01-sftp » (SFTP) ?
Merci.