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.
uidfile.uidmap raj:502 rahul:503 gidfile.gidmap prod:1023
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