Thursday, February 10, 2011

When you forgot to add auser during install Arch

Creating a user and giving a root password is part of the install.
I suppose you oversaw it.
Here is the solution:
User management

Local user information is stored in the /etc/passwd file. To list all user accounts on the system:

# cat /etc/passwd

To list users currently logged on the system, the who command can be used.

To add a new user, use the useradd command:

# useradd -g users -G group1,group2{,...} -m USERNAME

This command will create a new user named USERNAME belonging to the users group (GID 100 by default) and the specified supplementary groups. Groups are discussed below, and must be comma-separated.

For more advanced uses of useradd, type:

$ man useradd

To specify the user's password, type:

# passwd USERNAME

A guided tool is available for adding users:

# adduser

adduser asks common questions about the user with sane defaults and constructs a useradd command to run. It also sets the password and changes finger information.
source:
https://wiki.archlinux.org/index.php/Users_and_Groups


Furthermore:

when you create a user, and use the -m flag, the files in /etc/skel are placed in the home directory.


here is an example for creating a user who is in the most common groups:

useradd -g users -G users, wheel, hal, network, video, audio, optical, storage, power -m USERNAME

after using this command in terminal, you can go to the file "/etc/group" and open it with leafpad, now you can see all the groups of the system and which users are in these groups.


source: http://bbs.archbang.org/viewtopic.php?pid=1584#p1584

No comments:

Blog Archive

About Me

Exclusion of liability Regarding StillStupid: The use you make of the guides, tips and downloads that you listed on this web site or on another website to which I refer is entirely at your own risk. In no way can I be held liable for damage or consequential damages of any kind, which occurs as a result of that use.