Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Adding new users

I'm trying to add a new user account to my ftp server.

I used

useradd -p password -d /home/newuser -s newuser

now when he tries to log in it accepts the UID and asks for a password, when i try to enter the password it says access denied.

I'm kinda new to the ADMIN side, I inherited a huge mess from the last guy and have been trying to sort out the whole mess.

it is an FTP server but should allow ssh access.

Any help is greatly appreciated.

share|improve this question

marked as duplicate by Chris S Feb 17 '12 at 16:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 4 down vote accepted

By the useradd man page:

   -p, --password PASSWORD
   The encrypted password, as returned by crypt(3). The default is to disable the account.

So, you set the hashed password to be that of the actual one. The easiest option at this point is to manually reset the password. As root:

passwd <username>
share|improve this answer
I have visions of typeracer.. +1 for good answer. – Warner Mar 3 '10 at 20:31
how can i set a default password using adduser? – user36651 Mar 3 '10 at 20:35
Setting a default password is a pretty bad practice, as it creates a known exploit path. I'm guessing this is a pretty small scale environment, so I would recommend either generating a scary password for each new user (using apg or similar), or having the users stop by so they can type in their initial password. – Scott Pack Mar 4 '10 at 3:14

-p expects the password hashed using crypt. Use the passwd command to set the password interactively.

More specifically:

passwd newuser

share|improve this answer
how can i set a default password using adduser? – user36651 Mar 3 '10 at 20:28
I typically useradd and then passwd. Some distributions and UNIXes have scripts, such as in Linux's Slackware. I've known the script to be called adduser. If you don't have one, you can write your own. – Warner Mar 3 '10 at 20:31
If you really want to know how to generate password crypt, find a utility to do it for you or you can copy the password crypt for a password you know from /etc/shadow. Careful with escaping control characters such a $ when copy/pasting. – Warner Mar 3 '10 at 20:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.