RHEL: Map CIFS automatically upon login

Hi, I work at a university and one of our labs is looking for a way to map a NAS automatically upon login. I’ve combed through the documentation at the redhat.com site and not found anything definitive to help me accomplish what we need in our environment, so I’m hoping to get some help here. Here are the variables:

  • RHEL 7 or 8 workstation running Gnome
  • CIFS based NAS which currently works with Windows and Mac
  • Using SSSD to configure the machines for AD login.
  • Multi-user lab machines

What we’d potentially like to accomplish: Any user should be able to walk up to the lab computer, sign in and have it automatically mount either a common shared folder and/or a personal folder on the NAS. Access should be based on the AD credentials supplied at login.

Our IAM team has already configured everything on their end necessary to make SSSD work, and I’ve been able to successfully add our RHEL 7 and 8 machines to the domain and users are able to login and use the computers already. We have been having them manually mount the NAS doing a smb:// share and that works. So I think our issue is just in trying to figure out how to somehow automatically mount these with either a script, add on software, or GUI option.

I think I’ve covered everything I can think of, but if I’ve missed some details just let me know and I’ll find out.

Thanks in advance!
The.Pollard

I dont know exactly the way, but perhaps a direction.

You could eperiment with the package cifs-utils. I use it to automount cifs shares for my servers. The way i accomplish this is by adding the mount-string in /etc/fstab.

Cifs-utils user guide:
http://pserver.samba.org/samba/ftp/cifs-cvs/linux-cifs-client-guide.pdf

I usually point cifs utils to fetch the credentials from a file, if you find a way to populate the file with the current users credentials, it should be pretty easy.