User addition in Unix box


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting User addition in Unix box
# 1  
Old 12-31-2008
User addition in Unix box

Hi All,

Am using the following command to add a user in Unix box

useradd -d <default_path> -g 90 -p <pwd for the user> <user_name>

But am getting an error while using this command by root user.Let me know if this cmd is right or else is there any other command to add a user in unix box.
Ashok_oct22
# 2  
Old 12-31-2008
The -p option is non-standard.

Usually you can add users with useradd, but you'll need to change/set the password manually or use a different tool for that.

The fact that you're using -p indicates maybe a Linux box? What error are you getting? I tried your command on a linux box and it seems to work just fine.
# 3  
Old 01-02-2009
Version of unix/Linux?

Command actually submitted (with anything confidential X'd out) ?

Error message?

Contents of /etc/default/useradd ?

Notes:
If the home directory does not exist you might need "-m" (Create home directory) switch.
Some versions of "useradd" need a value in "-c" (comment). It's usual to put the users real name here.
# 4  
Old 01-06-2009
Am getting the error "bash: useradd: command not found" after i give the command

useradd -d /home/jan -g 90 -p jan1123 jan

This is the content inside the etc/default/useradd file

# useradd defaults file
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
Ashok_oct22
# 5  
Old 01-06-2009
It may not be in your path, try 'whereis useradd' to find out where the executable is. Then run it directly, specifying the full path(such as /usr/sbin/useradd)
# 6  
Old 01-07-2009
Thanks for that as i found out the executable. But this time am getting the error

useradd: unknown group 90

The command i used is "/usr/sbin/useradd -d /home/jan -g 90 -p jan123 jan"
Ashok_oct22
# 7  
Old 01-08-2009
Quote:
Originally Posted by Ashok_oct22
Thanks for that as i found out the executable. But this time am getting the error

useradd: unknown group 90

The command i used is "/usr/sbin/useradd -d /home/jan -g 90 -p jan123 jan"
Code:
grep 90 /etc/group

If there is no output, then there really isn't any group 90.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Generate unique user id with each addition of data

As I add new data to database.txt I want to generate a unqiue User Id. This is my current solution. echo $RANDOM:$lname:$fname >> database.txt But I seem to have problems when I try and use $RANDOM for formatting like so: grep "^4539" database.txt | awk -F":" '{print "User... (4 Replies)
Discussion started by: yonkers062986
4 Replies

2. Shell Programming and Scripting

ftp file starting with particular name on Windows box to Unix box using shell script

Hello all ! I'm trying to write a shell script (bash) to ftp a file starting with particular name like "Latest_" that is present on a Windows box to UNIX server. Basically I want to set this script in the cron so that daily the new build that is posted on the Windows box can be downloaded to the... (2 Replies)
Discussion started by: vijayb4u83
2 Replies

3. Shell Programming and Scripting

how to compare all files in one unix box has been to copied to another unix box

Hi our unix admin has copied all files from one unix box to new unix box. We just need to confirm that all the file systems are copied properly. How to validate. (9 Replies)
Discussion started by: sravanreddym
9 Replies

4. Shell Programming and Scripting

Moving files from Unix box to a windows box

Hi All, I need a little help .I want to transfer a file from unix box to a windows box,but the problem i'm facing is that in windows box FTP is not enabled and currently it is nearly impssible to change setting on windows box,i can not use the ftp method ,in my shell script to transfer the file.... (2 Replies)
Discussion started by: Preet
2 Replies

5. UNIX for Dummies Questions & Answers

Running UNIX commands remotely in Windows box from Unix box – avoid entering password

I am able to run the UNIX commands in a Windows box from a UNIX box through "SSH" functionality. But whenever the SSH connection is established between UNIX and Windows, password for windows box is being asked. Is there a way to avoid asking password whenever the SSH connection is made? Can I... (1 Reply)
Discussion started by: D.kalpana
1 Replies

6. Shell Programming and Scripting

how to find password for current user in unix box

hi all, kindly let me know the command to get password and user for current user in unix. thanks in advance. --Bali Reddy.Y (1 Reply)
Discussion started by: balireddy_77
1 Replies

7. UNIX for Advanced & Expert Users

How to FTP a file generated at UNIX Box to NT Box

Hi all, I am generating a file on the Unix machine , now i want to FTP the same file to the NT machine. how can i do that and the application currently upon which i am working is a JAVA based application. I need your help. regards Ruchir (2 Replies)
Discussion started by: Ruchir
2 Replies

8. UNIX for Advanced & Expert Users

VPN client (windows Box),and Server (Unix Box)

If I want to access unix box via VPN tunnel,from windows box. What sould I configure on the windows client PC, and what should I enable on the Unix Server box ? I am using Solaris V10 intel platform, and I am using windows XP, and 2003 for client (0 Replies)
Discussion started by: zillah
0 Replies
Login or Register to Ask a Question