Ssh

De BlaxWiki
Aller à la navigationAller à la recherche

Ssh Chroot

On peut avoir facilement un user chroot en ssh / sftp. Rajouter dans le fichier /etc/ssh/sshd_config

Match user userachrooter
         ChrootDirectory /home/%u
         X11Forwarding no
         AllowTcpForwarding no
         ForceCommand internal-sftp

Le répertoire du user doit appartenir au user root et le group au group du user. Le chmod doit obligatoirement être en 755 ou 751 sur le répertoire.

http://www.debian-administration.org/articles/590

Rsync over ssh

Sur la machine de destination
.ssh/authorized_keys  :
from="0.0.0.0/0",no-X11-forwarding,no-agent-forwarding,no-pty,command="exec /usr/bin/rsync --server --daemon --config /etc/rsyncd.conf ."
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAn3PqV+0WU/0/ankV/hw6KIjs+AjkVnJwJ+/vQ+AkGlNhprleapAlK5ur3Z6FPfBii84tSsssssssWLzTzo6998xslxq1LQd5Y/OCylF+D9KIaI3X03ggTTmPItitlQvE4eU+tH7w4iPfb2EBgLBkQsbqKWDUzjbzREG510+XabDrwGIkTvxPxzvBCd4e05kfipGpmR+qELU11Tb5j19C1Ge4Ox3iwS86z9ZaI8m8ogccuOB6YZYdkV7bucCnjiEaNIdwbQjx4NBIktgWO1dtZ+3l90leggwv5LqMF65FNETF8CFmDodYovRlx9TGTPuB0aMhCInjS0RNw==