Once you have a samba server (e.g. NAS) to store your data remotely, you might not satisfied by using the ftp to access your data. You can mount the remote directory to your client machine, and use it as if locally.
My case
Client OS: Ubuntu 12.04
Example:
Server: nas.spencer.com
Remote directory: /home/data
Remote account: spencer
Local account: spencer_local
Local directory: /home/spencer/localDic
You might need to install the cifs-utils first
sudo apt-get install cifs-utils
Create your local directory if not exist
sudo mkdir /home/spencer/localDic
Check your uid
id -u spencer_local
%assume it is 1005
Mount the directory using remote account and local uid to set the permission easily and correctly.%assume it is 1005
sudo mount -t cifs //nas.spencer.com/home/data /home/spencer_local/localDic -o username=spencer,uid=1005
If you want to unmount the directory
sudo umount /home/spencer_local/localDic
You can also assign permission like this:
sudo mount -t cifs //nas.spencer.com/home/data /home/spencer_local/localDic -o username=spencer,uid=1005,file_mode=0664,dir_mode=0775
Note:
1. You cannot use the ip of your server because of a bug in this linux kernel.
2. This post supposed to work under other Unix-like OS as well.
No comments:
Post a Comment