User Tools

Site Tools


sftp:configuring_the_user_home_directory

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

sftp:configuring_the_user_home_directory [2016/12/05 11:31] – created petersftp:configuring_the_user_home_directory [2019/12/04 20:45] (current) – removed peter
Line 1: Line 1:
-====== SFTP - Configuring the User Home Directory ====== 
- 
-In the root of the users home directory, creating symlinks to different parts of the server outside of the users home directory won't work as symlinks are relative to the root directory, which in this case is the user's chrooted home directory.  Instead, you must use mount with **--bind**. 
- 
-You first need to create a directory and them mount a directory somewhere else on the server to that directory.  For example: 
- 
-<code bash> 
-sudo mkdir /home/sftpuser/www 
- 
-sudo mount --bind /var/www /home/sftpuser/www 
-</code> 
- 
-This won't work if the /home/sftpuser/www directory existed previously. 
- 
-Made a mistake?  You can unmount a drive using the following command: 
- 
-<code bash> 
-sudo umount /home/sftpuser/www 
-</code> 
- 
-Since typical users don't have the required root access to execute these commands, and they would be lost as soon as you reboot the server.  However you can make these mounts permanent by adding them to the /etc/fstab file using the following command: 
- 
-<code bash> 
-sudo vi /etc/fstab 
-</code> 
- 
-Add the following line to the end of the file and save: 
- 
-<code> 
-/var/www /home/sftpuser/www none bind 
-</code> 
- 
-The next time you reboot your server, the directories will automatically be mounted. 
  
sftp/configuring_the_user_home_directory.1480937471.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki