LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-13-2014, 01:22 AM   #1
neha_sri
LQ Newbie
 
Registered: Jan 2014
Posts: 4

Rep: Reputation: Disabled
creating users in linux


hi,
I am very new to linux.I have admin rights.I want to create one user.How can I do that?
 
Old 01-13-2014, 01:29 AM   #2
kooru
Senior Member
 
Registered: Sep 2012
Posts: 1,385

Rep: Reputation: 273Reputation: 273Reputation: 273
Hi and welcome to LQ.

man useradd
http://www.thegeekstuff.com/2009/06/...e-linux-users/
and seeing that you use fedora: http://docs.fedoraproject.org/en-US/...-user-new.html
 
1 members found this post helpful.
Old 01-13-2014, 03:48 AM   #3
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
Hi Neha,

welcome to LQ, take a good linux reference book like one (redhat/fedora bible) by Eric foster Jhonson and Christofer Negus. This would help you understanding basics of linux.
 
Old 01-13-2014, 04:02 AM   #4
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
the command useradd can be used to create new users, in the terminal as root the syntax will be:
Code:
# adduser name
for more information about adduser type in the terminal:
Code:
$ man adduser
There is also the command useradd, but this one doesn't generate a complete profile for the new created user.

Regards
 
1 members found this post helpful.
Old 01-13-2014, 04:10 AM   #5
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
what did you mean by this ?
Quote:
command useradd, but this one doesn't generate a complete profile for the new created user.
did you tried running adduser without argument to see the usage ? :P
Code:
[root@test ~]# adduser
Usage: useradd [options] LOGIN

Options:

Last edited by SAbhi; 01-13-2014 at 04:11 AM.
 
Old 01-13-2014, 08:09 AM   #6
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by SAbhi View Post
...did you tried running adduser without argument to see the usage ?
Yes, they are 2 different commands adduser and useradd and also generate the user with different profiles structure, the second is kind of empty because it doesn't create the user with the structure from /etc/adduser.conf.

useradd
Quote:
Originally Posted by man
DESCRIPTION
useradd is a low level utility for adding users. On Debian, administrators should usually use
adduser(8) instead.
adduser
Quote:
Originally Posted by man
DESCRIPTION
adduser and addgroup add users and groups to the system according to command line options and
configuration information in /etc/adduser.conf. They are friendlier front ends to the low
level tools like useradd, groupadd and usermod programs, by default choosing Debian policy
conformant UID and GID values, creating a home directory with skeletal configuration, running
a custom script, and other features.
Regards

Last edited by ukiuki; 01-13-2014 at 08:10 AM.
 
1 members found this post helpful.
Old 01-13-2014, 08:28 AM   #7
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,330
Blog Entries: 1

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Something like:

# adduser --home /home/nameofuser --shell /bin/bash nameofuser

There also useradd, but one creates a home folder, the other doesn't. And distros like debian default to a dash shell if you don't override that default.

$ man adduser

$ man useradd

And of course you'll want to modify the groups the user is in as well.

# usermod -G audio,video,games,cdrom nameofuser

$ man usermod

Or other ways of doing that like modify-ing the /etc/group file directly.
 
Old 01-14-2014, 07:07 AM   #8
neha_sri
LQ Newbie
 
Registered: Jan 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
creating user in linux

I have used this command to add a user

# adduser name

but once I try to switch to this user it prompts for password,which I haven't set.
 
Old 01-14-2014, 07:41 AM   #9
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,133

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
you can set it by:
passwd username
 
Old 01-14-2014, 10:17 AM   #10
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by neha_sri View Post
I have used this command to add a user

# adduser name

but once I try to switch to this user it prompts for password,which I haven't set.
Now you have to set the password for the new user as suggested by pan64 with the command passwd.

Regards
 
Old 01-14-2014, 10:31 AM   #11
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
thats nice... its good i didnt knew about adduser utility anyway thanks @ukiuki.
 
1 members found this post helpful.
Old 01-15-2014, 11:51 PM   #12
neha_sri
LQ Newbie
 
Registered: Jan 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
creating user in linux

when I use command passwd <and some password> for the first time ,it says sorry,passwords do not match,i don't know which password it is trying to match my password.
 
Old 01-15-2014, 11:59 PM   #13
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

the new password needs to be entered twice. Also, if you provide an argument to the passwd command, it should be the username, not the password.

Evo2.
 
Old 01-16-2014, 03:13 AM   #14
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
@neha : its like --:
passwd [username]
 
1 members found this post helpful.
Old 01-16-2014, 04:28 AM   #15
neha_sri
LQ Newbie
 
Registered: Jan 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
connection to database

hi,
thanks for replying previous post.
I have created a user.I have postgres database in my linux system.I want to know how database connections are made.
 
  


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
Creating A Linux Script To Add Sequential Users. aapanju Linux - Newbie 4 03-03-2008 09:22 PM
Creating new users in linux without using addmod or user add frankthetank250 Linux - Newbie 5 10-29-2007 03:24 AM
Creating new users in linux without using addmod or user add frankthetank250 Linux - Newbie 1 10-28-2007 10:02 PM
Creating Users in Linux with specific rights: Issue?? rajnair0278 Linux - Software 1 07-10-2006 08:24 AM
creating new users skvasistha Linux - General 3 11-27-2004 12:02 AM


All times are GMT -5. The time now is 10:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration