You are not logged in.

#1 2015-03-05 10:14:37

sachin
Member
Registered: 2015-03-05
Posts: 1

files & directories are not share on server with 777 permission using

I am successfully mount the remote directories on my local directories, I have to created folder and files with 777 permission so others can able to access this files so that's why I used umask=000 option during mount process. But problem is these newly created folder and files not created with 777 permission on remote server(NFS Server) IT create with 775 permission.

I have two servers with following user.

1. NFS Server
   nfs2
   root
2. NFS clinet
   root
   stag

Following is the export entry on NFS server

    /home/nfs2/mnt *(rw,sync,no_root_squash)

Following command I used to mount directories...

    sshfs -o uid=1005,gid=1005,umask=000 nfs2@xxx.xxx.x.xx:/home/nfs2/mnt /home/stag/mount_point -o allow_other

After apply above command remote directory successfully mounted on /home/stag/mount_point with 777 permission.

Now I am creating directory using stag user.

    **stag@ubuntu:~/mount_point$ mkdir test
    stag@ubuntu:~/mount_point$ ls -l
    total 4
    drwxrwxrwx 1 stag stag 4096 Mar  5 14:24 test**

And it is created with 777 permission what I want, So on NFS client side I don't have any issue.


Now I checking on NFS server in /home/nfs2/mnt directory.

    **root@192:/home/nfs2/mnt# ls -l
    total 4
    drwxrwxr-x 2 nfs2 nfs2 4096 Mar  5 14:24 test**

As you see on NFS server test directory was created with 775 permission which did not I want, I want to create test directory with 777 permission.



I did everything to resolve this issue,

I set umask 000 into .bashrc file on NFS server but then also this issue not resolved.

I found following link in which one guy say I have apply patch for sshfs-fush to resolve the permission issue on server side and after that I have to used **remote_umask and remote_fmask** during mount process.

    **http://andre.frimberger.de/index.php/linux/sshfs-fix-for-wrong-file-permissions-on-server/comment-page-1/#comment-211337**

But I don't know How to apply this patch.

Any know how to resolve this problem then please help me.


Thanks

Offline

#2 2015-03-05 13:22:20

EscapedNull
Member
Registered: 2013-12-04
Posts: 129

Re: files & directories are not share on server with 777 permission using

sachin wrote:

I set umask 000 into .bashrc file on NFS server but then also this issue not resolved.

This won't affect processes started by systemd. According to this, you could use the UMask= option in your service file. Copy the sshfs service file from /usr/lib/systemd/system to /etc/systemd/system and add UMask= to the new file. Use

systemctl daemon-reload

then restart the sshfs service. See systemd.exec(5).

As for applying the patch, you can get sshfs from the ABS, and apply the patch following the instructions provided with it, then continue to build the package.

Offline

Board footer

Powered by FluxBB