Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-01-2013, 02:48 PM
|
#1
|
|
Member
Registered: Dec 2010
Posts: 89
Rep:
|
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.
|
|
|
|
02-01-2013, 03:05 PM
|
#2
|
|
Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 11,808
|
Quote:
Originally Posted by manalisharmabe
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/
|
|
|
|
02-01-2013, 03:18 PM
|
#3
|
|
Member
Registered: Dec 2010
Posts: 89
Original Poster
Rep:
|
Solaris 10
running as root
/home exit
|
|
|
|
02-01-2013, 09:09 PM
|
#4
|
|
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,625
|
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.
|
02-02-2013, 10:33 AM
|
#5
|
|
Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 11,808
|
Quote:
Originally Posted by manalisharmabe
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.
|
02-02-2013, 09:50 PM
|
#6
|
|
Member
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 681
Rep:
|
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.
|
02-03-2013, 02:00 PM
|
#7
|
|
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OL
Posts: 9,311
|
Quote:
Originally Posted by manalisharmabe
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.
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 and then restart autofs:
Code:
svcadm restart autofs
|
|
|
1 members found this post helpful.
|
02-07-2013, 01:38 PM
|
#8
|
|
Member
Registered: Dec 2010
Posts: 89
Original Poster
Rep:
|
Thanks all,
It is solved now.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:49 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|