LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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: 188

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,141

Rep: Reputation: 168Reputation: 168
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, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
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: 188

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, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
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, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
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: 188

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: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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: 188

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



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 04:54 PM.

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
Open Source Consulting | Domain Registration