Solaris 10 useradd confusion[solved]


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Solaris 10 useradd confusion[solved]
# 1  
Old 12-27-2012
Oracle Solaris 10 useradd confusion[solved]

I installed Solaris 10 (8/11) and added an account for myself. It lives in
Code:
/export/home/{name}

but /etc/passwd shows it is
Code:
/home/{name}

where it seems to be mounted like a filesystem. I tried to
create another account from the command line but it doesn't work the same way.
I can't find anything in the man page for useradd to duplicate this
functionality nor does a search on the internet show anyone else who has made it
work.

Anyone know how to do this?

Thanks in advance,

Edward Hooper

---------- Post updated at 04:04 PM ---------- Previous update was at 02:20 PM ----------

Looks like I get to answer my own question because I did another search and, finally, found the solution.

Create the user account as usual in
Code:
 /export/home:useradd -u <userid> -g <groupid> -m -s <shell> -d \ /export/home/<name> <name>

Then modify the home directory location:
Code:
usermod -d /home/<name> <name>

Add a line to /etc/auto_home so it gets mounted when the user logs in:
Code:
<name> 127.0.0.1:/export/home/<name>

And lastly, just to make certain it all works:
Code:
svcadm enable autofs

And that seems to work for me. Smilie I did notice that after the users log out the home directories are unmounted. Well, most of them. Smilie The account created at startup stays mounted even after I log out so there is something I'm missing. Smilie If anyone knows please let me know. Smilie

Last edited by jim mcnamara; 12-27-2012 at 10:36 PM..
# 2  
Old 12-28-2012
Did you leave any children of that id running under any id?
# 3  
Old 12-28-2012
Oracle

I'm not exactly certain what that means. I did select Save current setup on log out. Would that make the home directory stay mounted?
# 4  
Old 12-28-2012
If you have daemons that were launched from that id using sudo or the like, they may have the dir open. Do an fuser on the dir.
# 5  
Old 12-28-2012
I tried /export/home/<name>, /home/<name>, and /home/<name>/* as parameters to fuser and I didn't get any results. It's been a while since I used fuser and I don't remember all of the options. The man page didn't help much either. I seem to remember another, similar command that would take the user name as a parameter and show the open files along with the process that had them open.

What I did do was:
Code:
ps -ef | grep <name>

and found that there was a process running in the background (/usr/bin/VBoxClient) that I killed and it released the mount. When I logged back in as the user it started the process again.

I'm fine with this as long as I know that's what happening.
# 6  
Old 12-28-2012
While fuser is slow, it is very useful. Some versions take one file name, others many, but the output to stdout is pids white space separated, and to stderr file names and letters indicating what sort of open is present, although they blend together on the screen.
Code:
$ fuser .
.:    13350c   26022c   26561c   13349c   27207c   23147c   25528c   26972c   13
384c   18137c   26033c   26602c   26031c   26238c   28253c    8818c   25659c   2
6052c   13352c   20145c   16947c   25661c   20017c   13346c   28255c   26217c   
13343c   13347c   18140c   17035c   27201c   18135c   22761c   25530c    8819c  
 13351c   25522c   27119c   22759c   27190c   13344c   25643c   18136c   16788c
   25642c
 
$ ps -fp "`fuser .`"
.: ccccccccccccccccccccccccccccccccccccccccccccc
ps: wrong PID number 
     UID   PID  PPID  C    STIME TTY       TIME COMMAND
 my__id 26033 26031  0  Aug 16  ttyp9     0:00 ksh
 .
 .
 .
 .

https://www.unix.com/man-page/all/1/fuser/

The tool lsof is more than powerful enough to find such, too, if you have it and permissions. It can snoop out remote hosts, socket numbers, all sorts of fd info:
Man Page for lsof (all Section 8) - The UNIX and Linux Forums

Last edited by DGPickett; 12-28-2012 at 05:12 PM..
# 7  
Old 12-28-2012
Oracle

This is all running as root. When I tried
Code:
fuser /home/<name>

the output was
Code:
/home/<name>:

When I tried
Code:
fuser /home/<name>/.

the output was
Code:
/home/<name>/.:

When I changed directory to the home directory and tried
Code:
fuser .

the output showed process ids. I've been using various Unix and Linux boxen for 20 years and I've never seen a command behave this differently.

I have used lsof in that past. That was the command I remembered but couldn't put a name to. It's not on my system and I looked at the install CD for the package but didn't find it. Where can it be had for Solaris 10 8/11?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Audit useradd/userdel - Solaris 11

Linux audits in syslog, any time a user is deleted or added. However, I'm running a Solaris11 VM, and find no such entries. How can I enable auditing for useradd and userdel? Oracle's documentation on managing the auditing service, has been of no assistance. Thanks. Customizing What Is... (7 Replies)
Discussion started by: Nvizn
7 Replies

2. Shell Programming and Scripting

[Solved] Pdf Printing in Solaris

HI All I need help related to Pdf printing in Solaris.as I print pdf file in solaris it print garbage.how can I print pdf correctly. need help asap. Regards (21 Replies)
Discussion started by: smazshah
21 Replies

3. Solaris

Solaris 10 - memory management confusion

Hello i have a Problem - my Server is running with following MEM Information (from TOP): Memory: 32G phys mem, 4195M free mem, 10G total swap, 9788M free swap So i think - no problem, 4GB Free, not swapin. So - our programmer wants to know what process taking how much memory - i... (5 Replies)
Discussion started by: roorbacj
5 Replies

4. Shell Programming and Scripting

[SOLVED] sed -i not available in solaris 5.10

Hi All, i'm writing a script where i have to grep for a pattern and the 3 lines after the pattern and comment them out. Note that i have to do this for multiple files, i am able to grep the pattern and the next 3 lines but since solaris does not recognize the -i option, i was wondering if... (11 Replies)
Discussion started by: Irishboy24
11 Replies

5. Solaris

solaris version confusion

Hello sorry for this stupid question - but i have a Solaris 10 10/08 s10x_u6wos_07b server - and i dont know, what does this versioninfo "10/08 u6" mean - i think it is the version from installdate. but i often installed recommendet patchsets - i think a patchset doesn´t change the... (3 Replies)
Discussion started by: roorbacj
3 Replies

6. Solaris

audit useradd userdel usermod in solaris 10

the previous thread on this problem was closed with no resolution/workaround that i could see...have there been any breakthroughs? :wall: (0 Replies)
Discussion started by: lisah66
0 Replies

7. Shell Programming and Scripting

[SOLVED] Read XML for solaris

Hello I have this script that works fine in Linux But not on sun solaris. Can some one help me with the awk syntax for solaris. Linux: awk -F $0~/DBURL/ {print $7} /tmp/test.xml---------- Post updated at 11:16 AM ---------- Previous update was at 11:05 AM ---------- Sorry guys i got the... (0 Replies)
Discussion started by: pradeepmacha
0 Replies

8. UNIX for Advanced & Expert Users

Problem with useradd, -p option in Solaris 10

Good day all. I'm trying to add a user with useradd and the -p option to assign a project name, but the result is that the user is created with an error message: "UX: useradd: user.root name should be all lower case or numeric." The command: useradd -d /export/home/tester -g rtpgrp -G... (2 Replies)
Discussion started by: BRH
2 Replies

9. Solaris

useradd giving error in solaris 10

Hi, I have installed Solaris 10 in my PC and now installing Oracle10, but while adding a user i am getting following error: useradd -g oinstall -G dba -d /export/home/oracle oracle UX: useradd: ERROR: Inconsistent password files. See pwconv(1M). I have tried pwconv command,... (4 Replies)
Discussion started by: amitanshu.verma
4 Replies

10. Solaris

audit useradd, userdel on solaris 10

I just want to audit and log to syslog when a user is added, removed or modified from the system. According to the docs I have: #/etc/security/audit_control dir:/var/audit flags:ua minfree:20 naflags:ua plugin:name=audit_syslog.so.1; p_flags=ua But neither syslog nor auditreduce -c ua... (7 Replies)
Discussion started by: glisha
7 Replies
Login or Register to Ask a Question