Linux  redhat/cents  autofs /net/ question

Posted on 2013-09-19
Medium Priority
Last Modified: 2013-10-13

I have setup the auto fs on one of the sever and I need to go that server directory using  /net/hostname/directory.

How do I bring the hostname into /net directory.
Question by:mokkan
LVL 40

Expert Comment

ID: 39507465
please elaborate more on requirement
LVL 13

Accepted Solution

Daniel Helgenberger earned 2000 total points
ID: 39508672
This will be fairly easy to achieve.

We need something about the file system you want to use with autofs, for instance I suppose you want to use a network file system like samba, nfs, ftp, ssh?

The basic steps are for example to mount Samba shares:
make sure autofsd is installed and running, for instance on
yum install autofs
chkconfig autofs on

Open in new window

Then you need to configure auto.master to add a config for your new mountpoint and create a new file for your directory:
$ cat /etc/auto.master
/net /etc/auto.smb_net-hostname
$ cat /cifs /etc/auto.smb_net-hostname
hostA -fstype=cifs,rw,credentials=/etc/samba/smbcedentials_hostA ://hostA/sharename
hostB -fstype=cifs,rw,credentials=/etc/samba/smbcedentials_hostB ://hostB/sharename

Open in new window

Edit this file further for all the hostnames you need. Also, it assumes you have a credentials-file smbcedentials_hostX in place (see man mount.cifs)
service autofsd start

Open in new window

The shares are mounted and the local mount point created when you fist access the directory;
ls /net/hostA

Open in new window

LVL 13

Expert Comment

ID: 39552274
100% Correct helge000 ;P

Author Closing Comment

ID: 39569403
thanks a lot

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This installment of Make It Better gives Media Temple customers the latest news, plugins, and tutorials to make their Grid shared hosting experience that much smoother.
Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question