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 |
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 |
Quote:
man useradd Code:
bash: man: command not found |
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:
|
Hi,
Quote:
Be sure to add your user to the groups; Quote:
Quote:
|
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 |
Its preferable to use adduser instead.
But even if you decide to use useradd you have to read the manpage first. |
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. |
Quote:
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. Code:
uid=500(user1) gid=100(users) groups=4(adm),100(users) |
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.
|
All times are GMT -5. The time now is 04:34 AM. |