LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-23-2006, 01:44 AM   #1
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 183

Rep: Reputation: 30
Add new user problem


Ok,I feel really stupid now.I can't seem to add a new user on Fedora 3.I've done this before and it worked fine,there's some weird permission error,but i'm not sure what.Here's what I've done

Code:
groupadd Group
useradd -d /home/user -g Group username
passwd username
*****
if I try to login(ssh username@ip) I get the folowing error

Code:
/bin/bash: Permission denied
Here's my permissions

Code:
drwxrwxr--   3 root Group  4096 Jun 23 07:57 /home
drwxrwxrwx  2 root Group 4096 Jun 23 08:09 /home/user

ls -l /bin/bash
-rwxr-xr-x  1 root Group 616312 Oct 19  2004 /bin/bash
Not sure what's wrong.Please help,I don't want to be stupid anymore.Thanks

[/code]
 
Old 06-23-2006, 01:46 AM   #2
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
why is root the owner of the user's home directory?
 
Old 06-23-2006, 01:50 AM   #3
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
Have you double-checked the ownership of /home and /home/user? On my system, /home is owned by root:root and each user's directory is owned by the user, not root. I'd have expected something like:
Code:
drwxrwxr--   3 root root  4096 Jun 23 07:57 /home
drwxr-x---   2 user Group 4096 Jun 23 08:09 /home/user

Last edited by gilead; 06-23-2006 at 01:51 AM. Reason: must... type... faster...
 
Old 06-23-2006, 02:09 AM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL
Distribution: Funtoo
Posts: 6,926

Rep: Reputation: 128Reputation: 128
It works well here by issuing "adduser <username>" rather than useradd -- that let's you select the password, UID, user's /home directory, group, etc.
 
Old 06-23-2006, 02:10 AM   #5
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
Quote:
Originally Posted by Chinaman
It works well here by issuing "adduser <username>" rather than useradd -- that let's you select the password, UID, user's /home directory, group, etc.
I don't know for sure but adduser script (that lets you chose uid, group etc etc) i think is available only for slack.
 
Old 06-23-2006, 02:12 AM   #6
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 183

Original Poster
Rep: Reputation: 30
Ok,That makes sense,I've changed it to the above by doing.

Code:
chown root:root /home
chown user:Group /home/user

drwxrwxr--   3 root root  4096 Jun 23 07:57 home
drwxrwxrwx  2 user Group 4096 Jun 23 08:09 /home/user
but now I get the following error!

Code:
Last login: Fri Jun 23 09:01:54 2006 from ***
Could not chdir to home directory /home/user/: Permission denied
/bin/bash: Permission denied
 
Old 06-23-2006, 02:14 AM   #7
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL
Distribution: Funtoo
Posts: 6,926

Rep: Reputation: 128Reputation: 128
Quote:
Originally posted by prozac
I don't know for sure but adduser script (that lets you chose uid, group etc etc) i think is available only for slack.
Figures ... I know Slack's the oldest Linux distro, and since all the others came
afterwards, they're just trying to improve on it. Never has happened, though,
which makes my wonder why anyone uses them.
 
Old 06-23-2006, 02:18 AM   #8
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
Code:
chown -R user: /home/user
should have solved the problem.no need to give the group,it will automatically take the primary group of the user.
 
Old 06-23-2006, 02:18 AM   #9
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL
Distribution: Funtoo
Posts: 6,926

Rep: Reputation: 128Reputation: 128
Try this:
Code:
chown root.root /home
chmod 755 /home
chown <username>.users /home/<username>
chmod 711 /home/<username>
Should fix you right up.
 
Old 06-23-2006, 02:20 AM   #10
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
or better yet create another user and try with that user
Code:
useradd -g group user2
passwd user2
see if /home/user2 exists and who owns it. then use user2 to do the ssh login.
 
Old 06-23-2006, 02:27 AM   #11
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 183

Original Poster
Rep: Reputation: 30
That sorted home dir permissions thanks,but i still get the

/bin/bash: Permission denied

error when trying to log in
 
Old 06-23-2006, 02:31 AM   #12
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
what does your /etc/passwd say abt the user?
 
Old 06-23-2006, 02:35 AM   #13
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
That sorted home dir permissions thanks,but i still get the

/bin/bash: Permission denied

error when trying to log in
ls -l /bin/bash
ls -l /

If there's nothing wrong with the perms there try
ldd `which bash`
and check the perms on the libs it's linked against,
and the whole directory structure they live under ...



Cheers,
Tink
 
Old 06-23-2006, 02:36 AM   #14
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 183

Original Poster
Rep: Reputation: 30
Code:
user:x:500:500::/home/user/:/bin/bash
..
 
Old 06-23-2006, 02:39 AM   #15
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
nothing wrong with that. follow tinkster posts.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 09:59 AM
Samba 3.0: net user add - problem with password geodo Linux - Networking 1 12-06-2004 11:52 AM
Add User Problem.. chunk2609 Mandriva 2 05-31-2004 08:05 PM
Add user problem Swift&Smart Linux - Software 14 10-11-2003 11:32 AM
Add user problem... X11 Linux - General 1 03-21-2002 04:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration