课程: Linux System Engineer: Network Filesystems Using NFS and Samba
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Automount using a credentials file - Red Hat Enterprise Linux教程
课程: Linux System Engineer: Network Filesystems Using NFS and Samba
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.…