How can I restrict directory for www-data or other user

Now I used this command to create another user like www-data for using SFTP.
adduser --home /var/www/path/to/dir --shell /bin/false --ingroup www-data devuser

I got home directory: “/var/www/path/to/dir” but can I restrict the user from going outside this directory?

This is not a EasyEngine related question. Please use http://unix.stackexchange.com/ for such a question.

Thanks for your interest in EasyEngine.

Why this is not an EasyEngine related, when my server fully builds from EE. And why you don’t talk about the best practice for Ubuntu + EE that others can follow.

Very old and recurrent discussion. Here goes a response of mine from several months ago.