Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need to automount a user under a different home directory than in NIS

Posted on 2010-11-22
11
Medium Priority
?
504 Views
Last Modified: 2013-12-24
I have a user on NIS that has a home directory that is slightly different than what he has as his directory on the server. He needs to have the user log in to the different directory however and I have heard you can do this with automount but I am not sure how this works... ?
0
Comment
Question by:Thaidog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 31

Expert Comment

by:farzanj
ID: 34193574
I don't think I understand your problem correctly.

What is his home directory set to and what does the user want?  Please be specific.

There are multiple ways.

OPTION 1:
Change user's home directory:
usermod -d /home/new/dir -m USERID


OPTION 2:
Just create a symbolic link:

So suppose the current home directory is: /home/user1
And NIS wants point to: /home/user1A, which doesn't exist then

DO:

ln -s /home/user1 /home/user1A

0
 
LVL 1

Author Comment

by:Thaidog
ID: 34198876
His home directory as t is in NIs is:

[root@qweb077 ~]# ypcat passwd | grep euaj911
euaj911:***:Contractor Position:/ap/d/bwpsj:/bin/bash
[root@qweb077 ~]#

His home directoy on the server is:
 
[root@qweb077 ~]# finger euaj911
Login: euah914                          Name: Contractor Position
Directory: /ap/q/bwpsj                    Shell: /bin/bash
Last login Mon Nov 22 14:16 (EST) on pts/1 from 172.23.40.58
No mail.
No Plan.

I was hoping o get his done via automount if possible.
0
 
LVL 31

Accepted Solution

by:
farzanj earned 2000 total points
ID: 34200139
So I presume your mount point is:
/ap/q/bwpsj

And your remote directory is:
/ap/d/bwpsj

Remote mount.  Suppose the remote directory is at 192.168.0.254:/ap/q/bwpsj
You should have the following mount point in your local computer.
/ap/d/
And nothing inside it.

Now create automout as follows:
Edit /etc/auto.master file and append the following line at the end.
 
/ap/d    /etc/auto.misc  --timeout=60

Open in new window


Now edit /etc/auto.misc and append the following to the end of the file.
 
bwpjs    -rw,soft,intr       192.168.0.254:/ap/q/bwpsj

Open in new window


Now restart the service as  
service autofs restart

Open in new window

Now do:
ls /ap/q/bwpsj

Open in new window


It this works, try the following line in /etc/auto.misc file
*        -rw,soft,intr     192.168.0.254:/ap/d/&

Open in new window


Let me know if anything doesn't work
0
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 
LVL 1

Author Comment

by:Thaidog
ID: 34200316
This is along the lines of what I am looking for however the directory is actually local so I do not need to remote mount anything... just drop them in to the correct directory already mounted.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 34202302
Is the user's home on a separate partition?  I am not understanding why you want to mount when the home is not even remote.  Well, you can do it if at least it is a separate partition.  Then you will delete the IP address--all part before colon and leave out colon and onwards.
0
 
LVL 1

Author Comment

by:Thaidog
ID: 34202866
It is a separate partition. It was suggested to me that this was the proper way or at least the method this infrastructure handles this situation... maybe I am mistaken. In any event we will try it out...
0
 
LVL 31

Expert Comment

by:farzanj
ID: 34204857
If it is separate partition, it certainly makes sense because you would either mount it or automount it.  Normally people go with plane old mount but automount is certainly an option.  If it was remote, automount saves network resources by using it only when needed and then disconnecting it.

So do you need any more help with automount?  What OS are you using?  When you go to auto.master and auto.misc, you see sample syntax commented out.  But certainly if you need further help, please ask.  If you remove ONLY IP address above, the above syntax should work, if I made correct assumptions above.  If not, tell me what the mount point is supposed to be and where it has to be mounted, name of device (partition), etc.
0
 
LVL 1

Author Comment

by:Thaidog
ID: 34207396
The OS is CentOS 5.5. The thing is though is that it's an LVM mount that is mounted in fstab already. I am new to the environment but I do know that some of the boxes use a NAS with the NIS to mount home directories. Not sure if the person helping me was thinking this was the situation but it is clearly not with this box. Does it make sense to just use automount as an alias to switch the mount point for the home directory without actually mounting anything remotely?
0
 
LVL 31

Expert Comment

by:farzanj
ID: 34207852
Well, it does.  If you want to remove your mount and use automount, it is your choice.  You can quickly comment out its entry in /etc/fstab, and unmount it
umount /dev/NAME
And then try mounting using automount.  I would say automount may be used in most cases when mount is used.  If you want to keep the mount, then simply create a symlink.
0
 
LVL 1

Author Comment

by:Thaidog
ID: 34208085
Can't do that though the problem is that directory is where an application actually is and other users have to be able to access it also... to add to the mess they all use other "application proxy users" to execute the commands... not sure why all this is necessary.  It looks like the application team has actually changed the the directory path to the same as the other boxes so it does not look like we will have to do this no. Your information on autmount is helpful none the less and I will award you the points. Thanks.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 34208274
In your situation, should be a quick and easy fix.
0

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Suggested Courses

660 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