• [^] # Re: root:root

    Posté par . En réponse au message Cloisonner utilisateur ssh debian 8 (Résolu). Évalué à 1.

    Avec la configuration suivante dans /etc/ssh/sshd_config

    Match User test
    PasswordAuthentication yes
     ChrootDirectory /var/www/test
     ForceCommand internal-sftp
     ForceCommand internal-ssh
     X11Forwarding no
     AllowTCPForwarding no
    #tail -f /var/log/auth.log
    Mar 14 10:12:39 lnx-app-publishing-toulouse sshd[29782]: Accepted password for test from x.x.x.x
     port 59661 ssh2
    Mar 14 10:12:39 lnx-app-publishing-toulouse sshd[29782]: pam_unix(sshd:session): session opened for user test by (uid=0)
    Mar 14 10:12:39 lnx-app-publishing-toulouse sshd[29784]: fatal: bad ownership or modes for chroot directory /var/www/test
    Mar 14 10:12:39 lnx-app-publishing-toulouse sshd[29782]: pam_unix(sshd:session): session closed for user test
    #ssh test@x.x.x.x 
    test@x.x.x.x's password:
    Write failed: Broken pipe

    Avec la configuration suivante dans /etc/ssh/sshd_config

    Match User test
    PasswordAuthentication yes
     ChrootDirectory /var/www
     ForceCommand internal-sftp
     ForceCommand internal-ssh
     X11Forwarding no
     AllowTCPForwarding no
    #tail -f /var/log/auth.log
    Mar 14 10:14:36 lnx-app-publishing-toulouse sshd[29809]: Accepted password for test from x.x.x.x port 59662 ssh2
    Mar 14 10:14:36 lnx-app-publishing-toulouse sshd[29809]: pam_unix(sshd:session): session opened for user test by (uid=0)
    Mar 14 10:14:36 lnx-app-publishing-toulouse sshd[29811]: Received disconnect from x.x.x.x: 11: disconnected by user
    Mar 14 10:14:36 lnx-app-publishing-toulouse sshd[29809]: pam_unix(sshd:session): session closed for user test
    #ssh test@x.x.x.x
    test@x.x.x.x's password:
    Could not chdir to home directory /var/www/test/: No such file or directory
    This service allows sftp connections only.
    Connection to x.x.x.x closed.