1

I mounted a network drive (Storage Server) to the directory /home/ldap for all OpenLDAP client computers. If a user login one of the computers, their home directory will be set the mount point as: /home/ldap/users/{username}. Users can read and write to their directory freely.

Now I have a tester account in OpenLDAP named tester4 under group users and logged into one of the computers. After login, I run ls -al to check the permissions.

Location: tester4@Computer1:/home/ldap/users/tester4

$ ls -al
drwxr-xr-x 1 tester4 users     4096 Aug 30 20:57 .
drwxr-xr-x 1 root    usrstomgr 4096 Aug 30 18:17 ..
-rw-r--r-- 1 tester4 users      220 Aug 30 17:57 .bash_logout
-rw-r--r-- 1 tester4 users     3771 Aug 30 17:57 .bashrc
drwx------ 1 tester4 users     4096 Aug 30 17:57 .cache
-rw-r--r-- 1 tester4 users      655 Aug 30 17:57 .profile

I tried to create a directory in this directory but not successful. tester4 is the owner of the directory, why tester4 does not have the write permission?

Location: tester4@Computer1:/home/ldap/users/tester4

$ mkdir no
mkdir: cannot create directory ‘no’: Permission denied

Then, I directly use tester4 to login the storage server and create a directory.

Location: tester4@Storage:/home/ldap/users/tester4

$ mkdir no
$ ls -al
drwxr-xr-x 2 tester4 users     4096 Aug 30 23:02 no

What is the problem disallowing tester4 to write to the SSHFS mount point? The following is the commands (without sudo) I used to mount the network drive in Computer1, where casper is the admin user of Computer1.

sshfs -o allow_other -o kernel_cache -o auto_cache -o cache=no -o reconnect -o compression=no -o cache_timeout=6000 -o ServerAliveInterval=15 casper@{Storage IP}:/home/ldap /home/ldap

Update

If I change the owner of . directory to casper, tester4 can write to the directory. If tester4 create a file, the owner of the file is casper. How can I configure SSHFS to allow other users to write to the directory using their identity?

  • I doubt that this setup will work. You mount that ssfs with a specific user, in your case casper, and all file creations/modifications/deletes will be executed on the storage server with the user ID which has initiated the mount. So you either should mount the user home for each user ( maybe possible with autofs ), or why not use NFS? – Thomas Aug 30 '16 at 17:46
  • Sorry, I am new to mounting. If I use NFS, can I use root to mount the network folder and all other users can access the content under the basic Linux permission rules? – Kin Aug 30 '16 at 18:01
  • Basically yes. But the storage server should also be integrated to the LDAP server to do user and group name lookups. – Thomas Aug 30 '16 at 18:12
  • autofs seems easier than NFS. – Kin Aug 30 '16 at 18:18
  • 1
    NFS is easier to setup and maintain. You also would have to integrate the storage server to your LDAP server as the users need to login to the storage server to do a sshfs mount. And performance will be much better with NFS. Go for NFS. – Thomas Aug 30 '16 at 18:27

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.