I want to use one drive of the remote server in my current Linux system. So I have found out SSHFS is an option for that.. Using sshfs I am able to map the remote system drive as mount point in current Linux like below .

sshfs  -d -o debug,sshfs_debug,allow_other,nomap=ignore,idmap=file,uidfile=uidfile.uidmap,gidfile=gidfile.gidmap   root@XX.XX.XX.XX:/data/shared /data/sharedlocal/

content of the GID/UID file.



After this i can see the mount points , but when i create any file inside the mount point , its user is always root . I mean whatever i pass in this part [ root@XX.XX.XX.XX:/data/shared ] . If i use raj , all files created with raj as user. How can i have each user to create there own file in the like below:

-rw-r--r-- 1 raj prod 5 2017-07-02 20:01 rajfile
-rw-r--r-- 1 rahul prod 2 2017-07-02 20:01 rahulfile
  • 3
    The files on the server are created with the owner who is connecting to the remote server (in your case root). If you want to create the files with different owner, connect to the server using different user. There is no simple way around that. – Jakuje Jul 3 '17 at 7:14
  • @Jakuje..OK i got the point..but with allow_other anybody can see and go to mount and delete file...how about two users ...is there any way to limit it to only limited set of users... – anwaar_hell Jul 9 '17 at 15:15
  • There is a group permission that can be set to files and directories in Linux. – Jakuje Jul 9 '17 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.