- I create a user named "TEST"
- I want him to be able ONLY to be in ../var/www/
- He can't move from it, he can't do anything outside of the folder.
- And also I want him to do this through FTP, he will be automatically moved to this folder and can't even go to /home or whatever just ONLY the folder what I specify.
User test need a home folder to store config files (example: /home/test/.bashrc which is bash configuration file)
What you can do is make him the owner of directory in /var/www and he will be the only one able to access it.
chown -R test /var/www/target-dir
You can them make a link from /var/www to its home folder.
ln -s /var/www/target-dir /home/test/
Then if he connect through ftp/sftp/ssh he will be logged into is /home/test directory that contain a link to the folder he can modify.
If you do not want this user test to have too much rights, do not make him a sudoer. If you want to protect an other user home folder from being red, you can do as follow
chmod o-x /home/other_user