LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-15-2009, 09:09 AM   #1
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Rep: Reputation: 63
How to add user account(non-root)?


What's the best way to add user account in slackware 12.2?
I did this.
Code:
useradd user
But there is nothing except ftp in /home/.
 
Old 09-15-2009, 09:16 AM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Read the man page for the 'useradd' command. You have the right command, but need to specify more than just the username, in order for all the usual stuff to happen.

For example, you want to specify whether or not to create the home directory, and whether or not to use the contents of /etc/skel as the basic home directory contents. Also, you'll want to specify what groups the user will be a member of, including the default group. If the user is to have his own group, you'll need to create that group too, using the "groupadd" or "addgroup" command.

Sasha
 
Old 09-15-2009, 09:25 AM   #3
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Original Poster
Rep: Reputation: 63
Quote:
Originally Posted by GrapefruiTgirl View Post
Read the man page for the 'useradd' command. You have the right command, but need to specify more than just the username, in order for all the usual stuff to happen.

For example, you want to specify whether or not to create the home directory, and whether or not to use the contents of /etc/skel as the basic home directory contents. Also, you'll want to specify what groups the user will be a member of, including the default group. If the user is to have his own group, you'll need to create that group too, using the "groupadd" or "addgroup" command.

Sasha
Hello,
man useradd
Code:
bash: man: command not found
Can you post the complete command to add user account?
 
Old 09-15-2009, 09:26 AM   #4
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 227Reputation: 227Reputation: 227
Although, as Sasha says, you have the right command - you may find it easier using the "adduser" script which will create all the directories for you. As root run :
Quote:
adduser user
to add the user "user" to the system. Now you have created a user without creating it's home directory you may find it easier to "userdel user" then run "adduser user" on your system.
 
Old 09-15-2009, 09:28 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,122
Blog Entries: 3

Rep: Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404
Hi,

Quote:
Originally Posted by cola View Post
What's the best way to add user account in slackware 12.2?
I did this.
Code:
useradd user
But there is nothing except ftp in /home/.
I prefer the 'adduser' that is the frontend for 'useradd' that has been adapted for Slackware. Take a look at the script '/usr/sbin/adduser'. It is well documented.

Be sure to add your user to the groups;

Quote:
users floppy audio video cdrom plugdev power netdev
You can use the up-arrow for the recommended groups after you add the user to the 'users' group. You will see the following;
Quote:
Initial group [ users ]:
Additional UNIX groups:

Users can belong to additional UNIX groups on the system.
For local users using graphical desktop login managers such
as XDM/KDM, users may need to be members of additional groups
to access the full functionality of removable media devices.

* Security implications *
Please be aware that by adding users to additional groups may
potentially give access to the removable media of other users.

If you are creating a new user for remote shell access only,
users do not need to belong to any additional groups as standard,
so you may press ENTER at the next prompt.

Press ENTER to continue without adding any additional groups
Or press the UP arrow to add/select/edit additional groups
:audio cdrom floppy plugdev video power netdev <<< pressed up-arrow to get suggested groups
You can always escape out with the 'ctl-c'.
 
Old 09-15-2009, 09:28 AM   #6
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Thanks bgeddy,

I should have mentioned, not all Linuxes have both of "adduser" and "useradd" -- rather, I believe there's usually only one of them (the non-script version)

Sorry for that omission, Cola

Sasha
 
Old 09-15-2009, 09:29 AM   #7
sahko
Senior Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 1,041

Rep: Reputation: Disabled
Its preferable to use adduser instead.
But even if you decide to use useradd you have to read the manpage first.
 
Old 09-15-2009, 10:53 AM   #8
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.0/14.1
Posts: 3,482

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
You can create a file named /etc/default/useradd that will work with the useradd command. The file will look like this:

# Begin /etc/default/useradd

GROUP=100
HOME=/home/users
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel

# End /etc/default/useradd

When you add a user this file is read and the useradd command will create the user's home directory and prepopulate with anything found in /etc/skel.

You also can user kuser in KDE. The utility will provide some check boxes and text boxes to ensure the user's home directory is created as you want.
 
Old 09-15-2009, 11:36 AM   #9
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,019

Original Poster
Rep: Reputation: 63
Quote:
Originally Posted by Woodsman View Post
You can create a file named /etc/default/useradd that will work with the useradd command. The file will look like this:

# Begin /etc/default/useradd

GROUP=100
HOME=/home/users
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel

# End /etc/default/useradd

When you add a user this file is read and the useradd command will create the user's home directory and prepopulate with anything found in /etc/skel.

You also can user kuser in KDE. The utility will provide some check boxes and text boxes to ensure the user's home directory is created as you want.
Using kuser is easier.
What group should be selected from kuser.
I selected adm.
Now from non-root user account if i type kuser , i get a message.
Code:
Error opening /etc/shadow for reading.
id
Code:
uid=500(user1) gid=100(users) groups=4(adm),100(users)
 
Old 09-16-2009, 07:13 PM   #10
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.0/14.1
Posts: 3,482

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
You can run kuser only as root. When trying to run kuser from the KDE Run tool, kuser should prompt you for the root password. You also can run kuser with the kdesu command, but you still need to provide the root password.
 
  


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
"To add a new user account, log in to the root account" how do i do this (im new) pierce77x Linux - Newbie 4 12-28-2008 02:44 PM
root account or user account arodlinux Suse/Novell 3 12-23-2008 08:59 PM
samba - add user script - User account does not exist itzamecwp Linux - Server 2 01-18-2007 10:52 PM
is it legitimate and allowed and can be done to make another user account set uid and gid to null 0 to make another root account with different name and possibly not damage the debian system creating and using that new account BenJoBoy Linux - Newbie 12 01-29-2006 10:02 AM
add my user account to the root group konabumm Linux - Newbie 2 08-01-2003 11:44 AM


All times are GMT -5. The time now is 12:36 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration