simple adduser problem

Associate
Joined
10 Nov 2007
Posts
809
Location
Southampton
as some of you may know i have installed centOS and im now adding new users

after googling around for a while i came across two methods of doing so

Method 1

[root @ jon ~]# adduser dave -p password

this command ran fine i then ran logout from root.

i then tried to log in as dave but it said wrong password

so i googled a bit more and found this

Method 2

[root @ jon ~]# useradd -d /home/jon/dave2 -s /bin/bash -c "dave pc" dave2

i executed this and it ran fine i then went onto the next command

Method 2 cont...

[root @ jon ~]# mkdir /home/jon/dave2 && chown dave2 /home/jon/dave2 && passwd password

it throws an error saying the directory already exists

i have only typed this once


anyone any ideas on where im going wrong?
 
ok i have created the user and can successfully log in as dave2 now my next task to to associate /home/jon/dave2 to the user dave2 will keep things posted if i have any problems
 
i changed the owner of /home/jon/dave2 correctly now by using

chown dave2 /home/jon/dave2

now when i log in i get this error

last login sat 31:00:27:50 on tty1
no directory /home/jon/dave2!
logging in with home = "/"
-bash: /home/jon/dave2/. bash_profile:permission denied

i have had a look around but have not found anything of interest anyone know where im going wrong this time?
 
Back
Top Bottom