[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 110: Undefined array key "cached"
[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 111: Undefined array key "normal"
[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 112: Undefined array key "total"
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3391: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3393: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3394: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3395: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
Cabrillo College Linux Classes • View topic - useradd with password

useradd with password

UNIX/Linux System Administration

useradd with password

Postby denise gant on Thu Dec 11, 2008 2:01 pm

I have been playing around with adding a password at the same time that I add a password. So far my syntax does not work. Here is what I used last:
useradd -g 600 -u 601 -d /home/dog -p <password> dog
[color=#8000BF][b]Think like you have no brain[/b][/color]
User avatar
denise gant
 
Posts: 67
Joined: Tue Sep 02, 2008 7:13 pm

Re: useradd with password

Postby janischaffin on Thu Dec 11, 2008 6:02 pm

From the test example, I used:

useradd -d /home/grrr -g klingons -G federation -u 2521 -c "Worf son of Megh" -p worf1 worf and it worked (i think!)
janischaffin
 
Posts: 43
Joined: Tue Sep 02, 2008 6:49 pm

Re: useradd with password

Postby denise gant on Thu Dec 11, 2008 9:37 pm

thanks i'll have to check it out!
[color=#8000BF][b]Think like you have no brain[/b][/color]
User avatar
denise gant
 
Posts: 67
Joined: Tue Sep 02, 2008 7:13 pm

Re: useradd with password

Postby keivn dodd on Fri Dec 12, 2008 12:08 am

-G, --groups group,...
With this option a list of supplementary groups can be speci-
fied, which the user should become a member of. Each group is
separated from the next one only by a comma, without whitespace.
If not specified, the default from /etc/default/useradd is used.

-g, --gid gid
The group name or number of the user's main group. The group
name or number must refer to an already existing group. If not
specified, the default from /etc/default/useradd is used.

At first glance -g and -G appear to have different functionality until you realize -g will resolve group names to gids.
keivn dodd
 
Posts: 43
Joined: Sat Sep 13, 2008 2:30 am

Re: useradd with password

Postby Rich Simms on Fri Dec 12, 2008 9:48 am

Be wary of adding user passwords with the -p option. If you use for example -p abc123 that password in added to /etc/shadow in clear ASCII text (not encrypted). The passwd command will do the encryption.
User avatar
Rich Simms
Site Admin
 
Posts: 640
Joined: Thu May 15, 2008 2:44 pm


Return to CIS 191B - Fall 2008

Who is online

Users browsing this forum: No registered users and 0 guests

cron