• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1498
  • Last Modified:

useradd

hi
id like to use the command "useradd" but when i type
useradd i get "usage" and the related options

could anyone supply an example of how to add the user "paul"
i guess that a home dir has to be specified and a passwd and maybe some other stuff but i dont know what...or how to do it for that matter

thanks
paul
0
paulwhelan
Asked:
paulwhelan
  • 10
  • 8
1 Solution
 
alextrCommented:
useradd -d /home/paul -s /bin/csh paul

This is the minimum. Anyway you can type man useradd for details
0
 
paulwhelanAuthor Commented:
i typed "man useradd"
but there is no entry for it...
How can i get these man pages?
0
 
paulwhelanAuthor Commented:
also when i add this user and login i get this upon logging in

No directory! Logging in with home=/
Sun Microsystems Inc.   SunOS 5.7       Generic October 1998  
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

 
alextrCommented:
You must create the directory before or use switch -m.

Why don't you have man pages? Didi you install them when you installed SO?
0
 
paulwhelanAuthor Commented:
where do i type in "switch -m"
in what dir? and as root or as the user?
How exactly do I go about installing the man
pages....I never got the option when installing
solaris 7 on the server
thanks
paul
0
 
alextrCommented:
use

useradd  -d /home/paul -m -s /bin/csh paul

or execute
mkdir /home/paul
useradd -d /home/paul -s /nib/csh paul
chown paul /home/paul

for man page check if you have the path /usr/man in the MANPATH environment variable (to check execute
echo $MANPATH)
Otherwise in your .cshrc file insert

setenv MANPATH  ${MANPATH}:/usr/man


0
 
paulwhelanAuthor Commented:
doing
useradd  -d /home/paul -m -s /bin/csh paul
gave me
UX: useradd: ERROR: Unable to create the home directory: Operation not applicable.

also
mkdir /home/paul
mkdir: Failed to make directory "/home/paul"; Operation not applicable

??

also .cshrc was worryingly empty
i inserted the line u recommended and rebooted....

paul
0
 
alextrCommented:
You must be root user!!!
Have you the /home directory existing? If no, please use the home directory for users choosen in your system (sometimes it can be /export/home, but the it is the SYSADM who decides it).

What .cshrc are you looking at? It must be the one related ot the user you are still logged in, just to execute 'man useradd'. If you are logged in as root insert in .cshrc of root the line I told you. If you are logged in as a different user insert in .cshrc of this user
0
 
paulwhelanAuthor Commented:
i did all that as root

 /.cshrc was empty until i inserted the line you told me, now it contains just that one line

........i successfully added a user into /export/home

0
 
paulwhelanAuthor Commented:
also when i type in "whoami" when i login as "paul"
it says command not found.....
0
 
alextrCommented:
The problem is that in  environment you don't have any configuration.

You may do this

cp /etc/skel/local.cshrc ~root/.cshrc
cp /etc/skel/local.login ~root/.login

Or copy them to amy user you want to set (e.g. paul)

So you have a minimal environment setting.
If you want you can add any path in .cshrc file for line 'path' as well as the following

 /usr/sbin /usr/ccs/bin /etc  /usr/openwin/bin /usr/local/bin)

and any other path you want to have.
Then type 'source .cshrc' to have the setting works.

0
 
paulwhelanAuthor Commented:
doh!
edited the .cshrc file and then.....
#source .cshrc
source: not found

it just gets better and better eh?

thanks for the help
0
 
alextrCommented:
I see you have a very bad environment :-(
Anyway, logout and login again (it is a very bad trick, but it works around); it reload the .cshrc
What is your shell for your user?
0
 
paulwhelanAuthor Commented:
im not sure....csh?
maybe...
0
 
alextrCommented:
echo $SHELL
0
 
paulwhelanAuthor Commented:

#echo $SHELL
/bin/csh
0
 
alextrCommented:
I guess now it is all right, since you logged out and logged in. Is it the truth?
Anyway, if you want to get a good .cshrc for your user you may post your e-mail and I can provide it to you.

Now  I think it's time for me to gain point ;-)
Do you agree?
0
 
paulwhelanAuthor Commented:
sure do
boof1999@yahoo.com
thanks....
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 10
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now