Difference between revisions of "Add symbolic links to storage folder"
(Created page with 'You may need to share folders located in different users home directories. It is possible to create a symbolic link to achieve this.<br> For example I have my stuff in /home/asq...') |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
You may need to share folders located in different users home directories. It is possible to create a symbolic link to achieve this.<br> | You may need to share folders located in different users home directories. It is possible to create a symbolic link to achieve this.<br> | ||
For example I have my stuff in /home/asqu/data<br> | For example I have my stuff in /home/asqu/data<br> | ||
I want to make the contents of /home/asqu/data/documents available to my storage folder without moving it, so remote users who have access to my share through PPTP VPN can add stuff there.<br> | I want to make the contents of /home/asqu/data/documents available to my storage folder without moving it, so remote users who have access to my share through PPTP VPN can add stuff there.<br> | ||
I don't want them to access all the contents of my whole home folder. | I don't want them to access all the contents of my whole home folder. | ||
First edit /etc/samba/smb.conf and add the following lines: | First edit /etc/samba/smb.conf and add the following lines: | ||
<pre>[global] | <pre>[global] | ||
unix extensions=no</pre><pre>[storage] | unix extensions=no</pre><pre>[storage] | ||
follow symlinks=yes | follow symlinks=yes | ||
wide links=yes | wide links=yes | ||
</pre> | |||
Now restart Samba:<br> | </pre> | ||
Now restart Samba:<br> | |||
<pre>service samba restart | <pre>service samba restart | ||
</pre> | </pre> | ||
Now create the symbolic link:<br> | Now create the symbolic link:<br> | ||
<pre>cd /home/storage | <pre>cd /home/storage | ||
ln -s /home/asqu/data/documents | ln -s /home/asqu/data/documents | ||
</pre> | </pre> | ||
Now from Windows, go into the storage folder and access documents, create a file and go back to /home/asqu/data/documents in your shell and verify that the created file is there.<br> | Now from Windows, go into the storage folder and access documents, create a file and go back to /home/asqu/data/documents in your shell and verify that the created file is there.<br> | ||
Replace the appropriate paths and usernames. This way, all the stuff added into the symbolic link will actually be saved to my home folder. | |||
This also makes backup easy without having to include multiple locations.<br> |
Latest revision as of 19:47, 22 November 2010
You may need to share folders located in different users home directories. It is possible to create a symbolic link to achieve this.
For example I have my stuff in /home/asqu/data
I want to make the contents of /home/asqu/data/documents available to my storage folder without moving it, so remote users who have access to my share through PPTP VPN can add stuff there.
I don't want them to access all the contents of my whole home folder.
First edit /etc/samba/smb.conf and add the following lines:
[global] unix extensions=no
[storage]follow symlinks=yes wide links=yes
Now restart Samba:
service samba restart
Now create the symbolic link:
cd /home/storage ln -s /home/asqu/data/documents
Now from Windows, go into the storage folder and access documents, create a file and go back to /home/asqu/data/documents in your shell and verify that the created file is there.
Replace the appropriate paths and usernames. This way, all the stuff added into the symbolic link will actually be saved to my home folder.
This also makes backup easy without having to include multiple locations.