Pular para o conteúdo principal

Postagens

Mostrando postagens de abril, 2020

bad ownership or modes for chroot directory component

Queria deixar o diretório /var/www disponível para um usuário fazer SFTP nele, sem poder acessar os demais diretório do servidor. Configurei o acesso do usuário no /etc/ssh/sshd_config (outro post). Contudo ao tentar logar via sftp, obtinha o seguinte log Accepted password for MY_USER session opened for user MY_USER by (uid=0) fatal: bad ownership or modes for chroot directory component "/var/www/RESTRICTED_DIR" pam_unix(sshd:session): session closed for user MY_USER Removendo a configuração do usuário no sshd_config, o usuário MY_USER conseguia logar, mas com acesso a todos os diretórios. No man page do chroot que é utilizado para limitar o acesso diz que ChrootDirectory Specifies the pathname of a directory to chroot(2) to after authentication. All components of the pathname must be root-owned directories that are not writable by any other user or group. After the chroot, sshd(8) changes the working directory to the user's home directory. Ou seja, os diretór