Computing : Mounting remote directories

Connecting to a linux machine via ssh hinders the convenient use of tools like nautilus or thunar to access remote locations like windows shares or clouds. To facilitate access to remote shares some very simple scriplet are available (Centos 7 only):

  • mount-winhome  - mounts your Windows home share. By default you can access it at /tmp/$USER/winhome
  • mount-wingroup <name of group> - mounts a Windows group share. By default you can access it at /tmp/$USER/wingroup
  • mount-desycloud - mounts desycloud.desy.de via webdav. By default you can access it at /tmp/$USER/desycloud

The corresponding commands to unmount shares are umount-winhome, umount-wingroup <name of group), umount-desycloud.

All mounts require username/password authentication. For desycloud this can be conveniently replaced by a netrc-file containing a cloud-specific token, see here for some more details also about a more generic scriplet called wcm.

For Windows share there is no such alternative. Though it would be possible to automatically generate a kerberos-ticket for the windows domain, but the underlying gio/gvfs mount mechanisms currently fails to consume the ticket properly.

Be aware: the scriplets are very primitive an might fail under certain circumstances. A sample session:

[someuser@pal54 ~]$ /usr/local/bin/mount-winhome  # /usr/local/bin/ shouldn't be necessary, would usually be in your PATH
Username [someuser]: 
Password: 
... successfully mounted ntapwin1.desy.de/someuser$ under $XDG_RUNTIME_DIR/gvfs/smb-share:server=ntapwin1.desy.de,share=someuser$ 
... accessible under /tmp/someuser/winhome/

someuser@pal54 ~]$ ls -l /tmp/someuser/
total 4
lrwxrwxrwx 1 someuser it 69 Dec  8 21:08 winhome -> /run/user/3904/gvfs/smb-share:server=ntapwin1.desy.de,share=someuser$/

[someuser@pal54 ~]$ ls -l /tmp/someuser/winhome/ | head -2
total 510119
drwx------ 1 someuser it         0 Oct  4 14:02 AppData/

[someuser@pal54 ~]$ /usr/local/bin/umount-winhome
*** Unmounted smb://ntapwin1.desy.de/someuser$  

[someuser@pal54 ~]$ ls -l /tmp/someuser/
total 0