Linux redhat/cents autofs /net/ question


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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

please elaborate more on requirement
Daniel HelgenbergerCommented:
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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
100% Correct helge000 ;P
mokkanAuthor Commented:
thanks a lot
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.