View previous topic :: View next topic |
Author |
Message |
hudsonhauck Apprentice
Joined: 16 May 2002 Posts: 182 Location: Albany, CA
|
Posted: Mon May 20, 2002 4:39 am Post subject: creating new users |
|
|
Whenever I try to add a new user, say for example:
Code: | useradd -p asdf johnDoe |
, then I try to login as johnDoe, it tells me "Login Failed". I have tried changing the group, changing the password to make sure I got it right, changing every "usermod" I could and it never would let me log in!! What the hell!! _________________ Matthew Hauck
http://matthauck.blogspot.com/ |
|
Back to top |
|
|
DArtagnan l33t
Joined: 30 Apr 2002 Posts: 942 Location: Israel, Jerusalem
|
Posted: Mon May 20, 2002 5:53 am Post subject: adduser |
|
|
simply type:
#groupadd [group name]
#adduser_command -g [group you've entered] -s /bin/bash -d /home/[user] -m
There are more options... _________________ All for one and one for All
--
MACPRO machine... |
|
Back to top |
|
|
hudsonhauck Apprentice
Joined: 16 May 2002 Posts: 182 Location: Albany, CA
|
Posted: Mon May 20, 2002 6:00 am Post subject: |
|
|
Ok, I can log into my other accounts now, but which groups should they be in? Right now, with no group specified, I can't even go into my ~/.fluxbox folder to edit the default menubar that has only xterm, restart, and exit. _________________ Matthew Hauck
http://matthauck.blogspot.com/ |
|
Back to top |
|
|
DArtagnan l33t
Joined: 30 Apr 2002 Posts: 942 Location: Israel, Jerusalem
|
Posted: Mon May 20, 2002 6:20 am Post subject: groups |
|
|
you should make a group named as username [ not a must ]
For example:
to be able to connect as SU ( supper user ) your user must be in "wheel" group.
mine looks like that:
i made my own group:
#groupadd liviu
#useradd -g liviu -d /home/liviu -s /bin/bash liviu -m
Here i was added an user named "liviu" in group "liviu"
Then i added this user to group wheel too:
#man groupmod
( i don't remmember the command because i'm in win now )
pacman _________________ All for one and one for All
--
MACPRO machine... |
|
Back to top |
|
|
DArtagnan l33t
Joined: 30 Apr 2002 Posts: 942 Location: Israel, Jerusalem
|
Posted: Mon May 20, 2002 6:22 am Post subject: |
|
|
Quote: | Right now, with no group specified, I can't even go into my ~/.fluxbox folder to edit the default menubar that has only xterm, restart, and exit. |
I did not understand _________________ All for one and one for All
--
MACPRO machine... |
|
Back to top |
|
|
hudsonhauck Apprentice
Joined: 16 May 2002 Posts: 182 Location: Albany, CA
|
Posted: Mon May 20, 2002 7:50 am Post subject: |
|
|
My user privelages are really messed up. I have a user named matt. matt is in wheel group. matt cannot create any files even in his own directory!! Why??? _________________ Matthew Hauck
http://matthauck.blogspot.com/ |
|
Back to top |
|
|
DArtagnan l33t
Joined: 30 Apr 2002 Posts: 942 Location: Israel, Jerusalem
|
Posted: Mon May 20, 2002 9:25 am Post subject: |
|
|
login as root and enter in matt home dir.
run there ls -la and make sure the owner is mat:
1) #ls -la /home
2) #ls -la /home/matt
If matt is not owner then make changes:
#chown matt:matt file_name_here
and so on.... _________________ All for one and one for All
--
MACPRO machine... |
|
Back to top |
|
|
hudsonhauck Apprentice
Joined: 16 May 2002 Posts: 182 Location: Albany, CA
|
Posted: Mon May 20, 2002 6:34 pm Post subject: |
|
|
Nope, the /home/matt folder belongs to "users" as to matt's files _________________ Matthew Hauck
http://matthauck.blogspot.com/ |
|
Back to top |
|
|
tomte Tux's lil' helper
Joined: 08 May 2002 Posts: 122
|
Posted: Mon May 20, 2002 7:20 pm Post subject: |
|
|
this should fix your problem
Code: | $> usermod -g users -G wheel,audio,video,... -s /bin/bash -d /home/matt matt
$> chmod -R matt.users /home/matt |
look at -g and -G: with -g you specifie the primary group, with -G additional groups the user should belong to, so replace the ellipsis with whatever is needed.
If this doesn't fix your problem, you should post the output of
Code: |
$> ls -la /home/matt
$> grep matt /etc/passwd
|
to give us a clue on whats going wrong
regards,
tom |
|
Back to top |
|
|
hudsonhauck Apprentice
Joined: 16 May 2002 Posts: 182 Location: Albany, CA
|
Posted: Mon May 20, 2002 7:36 pm Post subject: |
|
|
I got it. Even though /home/matt was owned by users, /home was still owned by the root (i don't know why). After I chown :users /home, everything worked fine. Thanks guys for your help. (I didn't understand the diff between -g and -G, but now, I do) _________________ Matthew Hauck
http://matthauck.blogspot.com/ |
|
Back to top |
|
|
tomte Tux's lil' helper
Joined: 08 May 2002 Posts: 122
|
Posted: Mon May 20, 2002 7:47 pm Post subject: |
|
|
hudsonhauck wrote: | I got it. Even though /home/matt was owned by users, /home was still owned by the root (i don't know why). After I chown :users /home, everything worked fine. |
This may solve your problem, but it's wrong: /home should belong to root.root, /home/matt should belong to matt.users and the permissions should look like this:
Code: |
$> ls -l /home
total 4
drwxr-xr-x 59 matt users 4096 May 20 21:30 matt
|
regards,
tom |
|
Back to top |
|
|
hudsonhauck Apprentice
Joined: 16 May 2002 Posts: 182 Location: Albany, CA
|
Posted: Mon May 20, 2002 8:45 pm Post subject: |
|
|
Ok, I didn't know that. I changed /home back to root.root. then i did what you told me to do 3 posts back and I got this:
Code: | bash-2.05a# chmod -R matt.users /home/matt
chmod: invalid mode string: `matt.users' |
Here is the othere stuff you wanted.
Code: | bash-2.05a# ls -la /home/matt
total 416
drwxr-xr-x 5 matt users 4096 May 20 13:05 .
drwxr-xr-x 6 root root 4096 May 19 20:38 ..
-rw------- 1 matt users 0 May 20 13:05 .Xauthority
-rw-r--r-- 1 222 users 438 May 19 20:16 ._cfg0000_.bash_profile
-rw-r--r-- 1 222 users 397 May 19 20:16 ._cfg0000_.bashrc
-rw------- 1 matt users 1397 May 20 13:05 .bash_history
drwx------ 2 matt users 4096 May 20 12:27 .fluxbox
drwxr-xr-x 4 matt users 4096 May 20 12:28 .mozilla
-rw-r--r-- 1 matt users 5 May 20 12:54 .wmix.pidq?
-rw-r--r-- 1 matt users 123 May 20 12:27 .xinitrc
drwxr-xr-x 4 matt users 4096 May 20 12:46 .xmms
-rw------- 1 root root 378334 May 19 23:10 hotkeys_0.5.4.tar.gz |
and
Code: | bash-2.05a# grep matt /etc/passwd
matt:x:1000:100::/home/matt:bin/bash |
_________________ Matthew Hauck
http://matthauck.blogspot.com/ |
|
Back to top |
|
|
tomte Tux's lil' helper
Joined: 08 May 2002 Posts: 122
|
Posted: Mon May 20, 2002 8:59 pm Post subject: |
|
|
o hudsonhauck wrote: | Ok, I didn't know that. I changed /home back to root.root. then i did what you told me to do 3 posts back and I got this:
Code: | bash-2.05a# chmod -R matt.users /home/matt
chmod: invalid mode string: `matt.users' |
|
Ooooops, my fault, chmod should read chown (just to make sure everything in your home-dir belongs to the user matt)
hudsonhauck wrote: |
Here is the othere stuff you wanted.
Code: | bash-2.05a# ls -la /home/matt
total 416
drwxr-xr-x 5 matt users 4096 May 20 13:05 .
drwxr-xr-x 6 root root 4096 May 19 20:38 ..
-rw------- 1 matt users 0 May 20 13:05 .Xauthority
-rw-r--r-- 1 222 users 438 May 19 20:16 ._cfg0000_.bash_profile
-rw-r--r-- 1 222 users 397 May 19 20:16 ._cfg0000_.bashrc
-rw------- 1 matt users 1397 May 20 13:05 .bash_history
drwx------ 2 matt users 4096 May 20 12:27 .fluxbox
drwxr-xr-x 4 matt users 4096 May 20 12:28 .mozilla
-rw-r--r-- 1 matt users 5 May 20 12:54 .wmix.pidq?
-rw-r--r-- 1 matt users 123 May 20 12:27 .xinitrc
drwxr-xr-x 4 matt users 4096 May 20 12:46 .xmms
-rw------- 1 root root 378334 May 19 23:10 hotkeys_0.5.4.tar.gz |
and
Code: | bash-2.05a# grep matt /etc/passwd
matt:x:1000:100::/home/matt:bin/bash |
|
the last line is a problem, the shell entry "bin/bash" should read "/bin/bash", a typo?
beside this I'm out of luck: your home dir is yours, a shell entry is there (you can correct it with "usermod -s /bin/bash matt"), this output allowed me to just check the basic possible errors
besides that: there is a file that belongs to root.root in matts home-dir; you should never work as root, perform just the absolutly necessary steps as root!
regards,
tom |
|
Back to top |
|
|
hudsonhauck Apprentice
Joined: 16 May 2002 Posts: 182 Location: Albany, CA
|
Posted: Mon May 20, 2002 9:16 pm Post subject: |
|
|
Cool, that works now. It must have been that one root file in there then, I guess. The reason I was working as root was becuase I couldn't do anything as matt. Thanks for the help. _________________ Matthew Hauck
http://matthauck.blogspot.com/ |
|
Back to top |
|
|
|