For security and other reasons this is server’s job to ensure that users stay in particular directory only.
Some SSH/SFTP servers have the function built-in, such as:
ChrootDirectory keyword).Most FTP servers have the function built-in.
Site design by Black Gate