OK, I'm a Linux newbie... I followed this tutorial https://linuxconfig.org/how-to-setup-sftp-server-on-ubuntu-18-04-bionic-beaver-with-vsftpd
My objetive is to create a new user with access vía SFTP to /var/www
Following the tutorial edited sshd_config
sudo nano /etc/ssh/sshd_config
Added this to the file
Match group sftp
ChrootDirectory /home
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
And restarted SSH
sudo service ssh restart
Created new group
sudo addgroup sftp
Create new user
sudo useradd -m sftpuser -g sftp
Set user password
sudo passwd sftpuser
After this I try to connect to the server using SFTP and works but when I go to /var/www get this error in filezilla:
Comando: cd "/var/www"
Error: Directory /var/www: no such file or directory
Error: Error al recuperar el listado del directorio
I need this user to work for /var/www it is his only function. The server has another users and I'm worried of breaking something if I mess arround with the permission of folders.