From the course: Linux System Engineer: Network Filesystems Using NFS and Samba

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Automount using a credentials file

Automount using a credentials file - Red Hat Enterprise Linux Tutorial

From the course: Linux System Engineer: Network Filesystems Using NFS and Samba

Start my 1-month free trial

Automount using a credentials file

- [Instructor] For this exercise you want to be logged into your rhhost2 VM and have a terminal open. Automounting a private share can be problematic because even though we can specify username= and password= in the NCFS tab file, everyone can see the contents as that file's world readable. The solution is to put the username and password information in a credentials file that only root can read, and then reference that file in the NCFS tab. Let's create our credentials file for our private share using VI. Type in sudo vi /root/sambaprivate.cred and hit enter. Type in your password if prompted. The name is arbitrary, you can name yours whatever you want. If you save it somewhere else besides /root, you'll need to make sure that nobody but root can read it by changing permissions. Now, let's go into insert mode by pressing the I key and then add our username and password key value pairs. In my case, it's username equals user1 and then password equals password. Enter your password here.…

Contents