LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 02-01-2013, 02:48 PM   #1
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Rep: Reputation: 1
Adding User in Solaris Error.....


Hi all,

when I type this command

Code:
useradd -d /home/ram89 -m ram89


it gives an error unable to create home directory.

Why so ?

How to create user in Solaris?

The perfect method?

Please guide me.

Thanks in advance

Manali.
 
Old 02-01-2013, 03:05 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by manalisharmabe View Post
Hi all,
when I type this command

Code:
useradd -d /home/ram89 -m ram89

it gives an error unable to create home directory. Why so ? How to create user in Solaris? The perfect method?
You don't give any details (version of Solaris? Running this as root? SUDO? Does the directory already EXIST? Using LDAP/NIS?), so it's hard to say. It's either a permissions issue, the directory exists, the /home partition isn't present (or writable), or you're not putting the command in correctly.

If you want a 'perfect method', then read the man page on the useradd command.
http://www.tech-recipes.com/rx/16/ad...ne-in-solaris/
 
Old 02-01-2013, 03:18 PM   #3
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
Solaris 10
running as root
/home exit
 
Old 02-01-2013, 09:09 PM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
By default /home directory has root:root as owner and do not has write permission for group or other.
Code:
# ls -ld /home
drwxr-xr-x  37 root     root        1024 Jul 17  2012 /home
In your case, perhaps you're not login as root, so you do not have write permission in /home and you cannot create a home directory for new user. Therefore it's throwing error.

In order to do it successfully, switch to root user.

---- ADD ----
Also if you are already running as root, then there's probability that /home isn't there or not mounted. Instead in Solaris 10, you will find /export/home mount point for home directories.
So you can check and try like:
Code:
~# ls -ld /home
~# ls -ld /export/home
~# df -k /home /export/home

~# useradd -d /export/home/ram89 -m ram89

Last edited by shivaa; 02-01-2013 at 09:15 PM. Reason: Added
 
1 members found this post helpful.
Old 02-02-2013, 10:33 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by manalisharmabe View Post
Solaris 10
running as root
/home exit
No idea what you mean by "/home exit". And you were provided a link with some things to try...did you? If you're not going to provide any more information, there's little incentive for us to help, if we've got to try to pull things out of you.

AGAIN:
  • Are you logged in as root?
  • Did you SU to root?
  • Did you use SUDO to get to a root shell?
  • Did you use SUDO to run the command?
  • Does the directory already EXIST?
  • Using LDAP/NIS?
  • Does the /home directory even EXIST?
  • Is the /home partition mounted?
  • Is the /home partition read/write, or read-only?
 
1 members found this post helpful.
Old 02-02-2013, 09:50 PM   #6
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
Solaris uses /export/home normally, while it is possible to use just /home there are other things you have to do first. Quick and dirty you can manually create the home dir and leave off the -m then change ownership after creation.
 
2 members found this post helpful.
Old 02-03-2013, 02:00 PM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by manalisharmabe View Post
when I type this command
Code:
useradd -d /home/ram89 -m ram89
it gives an error unable to create home directory.
Why so ?
Because /home is managed by the automounter by default under Solaris.
Quote:
How to create user in Solaris?
The perfect method?
There is no "perfect method". There are various methods that better suit various needs.
Quote:
Please guide me.
In your case, the simplest would be to disable /home specific handling by commenting out (or removing) the line about it in the /etc/auto_master file
Code:
# /home         auto_home
and then restart autofs:
Code:
svcadm restart autofs
 
1 members found this post helpful.
Old 02-07-2013, 01:38 PM   #8
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
Thanks all,

It is solved now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Adding a new user to Solaris 9 so that this user can ssh into the server rcforster Solaris / OpenSolaris 2 03-14-2011 06:10 AM
Error adding new user to samba pdc alissonbn Debian 2 09-01-2008 12:14 PM
TDB Error When Adding New SMB User using Smbpasswd hevfuture Linux - Server 0 03-28-2008 10:43 AM
Adding a new user in Solaris zaicheke Solaris / OpenSolaris 5 10-24-2004 01:04 PM
Error adding new user mrpc_cambodia Red Hat 3 10-17-2004 10:57 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 04:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration