0

i have a command to manually mount windows shares into my linux system. Unfortunately the paths are not mounted when the system reboots. How can I add the path to the fstab table ?

 mount -t cifs -o user=myuser,domain=ad.myad.com //path/to/Software/bundles /mysoftware

The problem is I still have a password which has to be entered as soon as the command is executed.

M. Antony
  • 3
  • 1

1 Answers1

3

Read the online manual for the specific section on mounting cifs file systems and you'll find an option to store the credentials in a external file so you won't have to add them to the world readable /etc/fstab and can keep those private: man mount.cifs

credentials=/path/filename
specifies a file /path/filename that contains a username and/or password and optionally the name of the workgroup. The format of the file is:

username=value
password=value
domain=value

This is preferred over having passwords in plaintext in a shared file, such as /etc/fstab. Be sure to protect any credentials file properly.

The /etc/fstab entry will then look something like :

//path/to/Software/bundles /mysoftware cifs credentials=/path/filename,_netdev,other,options 0 0 
HBruijn
  • 72,524
  • 21
  • 127
  • 192