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
Solved

Solaris 10: autofs for /export/home to /home

Posted on 2009-05-11
5
1,966 Views
Last Modified: 2013-12-27
Hi,
I want /home/<user> to point to /export/home/<user>I cant seem to get it working... current config are as code snippets.

Also, is there a way to create the <user> folder upon execution of useradd?

1) ssh to newly created account
Error: Could not chdir to home directory /home/test01: No such file or directory
2) cat /etc/auto_home
+auto_home
* localhost:/export/home/&
 
3)  cat /etc/auto_master
/home          auto_home       -nobrowse
 
4) # svcs | grep -i autofs
online         17:52:04 svc:/system/filesystem/autofs:default
 
5) ls -la /export/home
total 22
drwxr-xr-x   4 root     root         512 May 11 16:00 .
drwxr-xr-x   3 root     sys          512 May  8 16:16 ..
drwx------   2 root     root        8192 May  8 16:16 lost+found
drwxr-xr-x   2 test01   staff        512 May 11 16:00 test01
 
6) cat /etc/passwd
test01:x:5002:10::/home/test01:/bin/sh
 
7) /usr/sbin/mount
:
:
/export/home on /dev/dsk/c1t0d0s5 read/write/setuid/devices/intr/largefiles/logg                                                                             ing/xattr/onerror=panic/dev=800007 on Mon May 11 16:53:48 2009

Open in new window

0
Comment
Question by:QLJ
  • 3
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
blu earned 80 total points
ID: 24353715
So, what happens when you do "cd /home/test01" ?

As for the question about useradd, the answer is "sort of"

If you read the usradd man page, you will see a flag called "-b" which specifies a base directory and one called
"-m" which says to create the directory. Your problem is that you need to create the directory in one place, and
specify the actual string used in another. So to add your user and create the home directory:

useradd -m -b /export/home -u 5002 test01

Then immediately after that succeeds:

usermod -d /home/test01 test01

That will change the home directory to the aut0mount directory.
0
 
LVL 1

Author Comment

by:QLJ
ID: 24355447
cd /home/test01 gives a "does not exist"

does it mean the /export/home/test01 will be created automatically?
0
 
LVL 22

Expert Comment

by:blu
ID: 24355526
The idea is to tell useradd that the home directory is at /export/home/test01 when it creates the directory. Then
once the directory, change the home path to /home/test01. You may need to refresh the autofs service. If not,
it might still be a while before it shows up in /home/test01. And that is only after you get the autofs thing
working in the first place.
0
 
LVL 1

Author Comment

by:QLJ
ID: 24361570
Hmm, seems like I dont need autofs after all... Is there any other added benefits of using such a mapping for /home?
0
 
LVL 22

Expert Comment

by:blu
ID: 24363607
Well, there isn't much use for it on a single system. The advantage comes mainly when you start sharing a home directory over multiple systems.

One possible advantage on a single system comes if it is a server with many users. That way all
the users can have the same home path (/home/username) when the actual directories live on
multiple disk volumes. (/export/home/disk1/username, /export/home/disk2/username).

Other than that, there isn't much point.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Audit HISTFILE for all users on AIX 9 145
FTP on FreeBSD server 2 141
Virtualizing TAPE on dual VIOS 3 101
Expiration and Locking of Unix/Solaris OS Accounts 7 49
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

856 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