LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-10-2011, 08:02 AM   #1
gabriel.560
LQ Newbie
 
Registered: Jan 2009
Posts: 17

Rep: Reputation: 0
problem with home direcotry not under /home in CentOS


Hi, I'm running CentOS on vmware.

I've created a user named al with home directory "/users/al" (/users directory exists and owned by root with 755 permissions).

When i log in i get a message "No directory /users/al. Logging in with HOME=/". The directory does exist, it was created when i added the user. I can cd into it with al and al is the owner of it.
When i try to log in using putty and ssh i get a different message: "Permission denied" but again i can cd to the directory.

It's really important that my users home direcotries will be under /users and not /home.

Thanks.
 
Old 08-10-2011, 08:10 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
check the /etc/passwd which is home directory for user al
when we create user we can specify the home_directory other than the default
#useradd -d /path username

Last edited by kirukan; 08-10-2011 at 08:15 AM.
 
Old 08-10-2011, 08:20 AM   #3
gabriel.560
LQ Newbie
 
Registered: Jan 2009
Posts: 17

Original Poster
Rep: Reputation: 0
I've created the user with "useradd -d /users/al -m". The home directory in /etc/passwd is /users/al and the directory does exist.
 
Old 08-10-2011, 08:29 AM   #4
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Quote:
#useradd -d /usr/local/ram ram
ram:x:501:501::/usr/local/ram:/bin/bash
drwx------ 3 ram ram 4096 Aug 10 21:15 ram
Just before I did test, everything fine to ssh using ram. In your case check further /var/log/secure, /var/log/audit/audit.log and SElinux
 
Old 08-10-2011, 10:17 AM   #5
gabriel.560
LQ Newbie
 
Registered: Jan 2009
Posts: 17

Original Poster
Rep: Reputation: 0
I found that it has to do with SELinux. I disabled it and now it works. Thanks.
 
Old 08-10-2011, 07:21 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
personally i would NOT change /home/UserName
way too many things depend on $HOME

Quote:
I found that it has to do with SELinux. I disabled it and now it works. Thanks.
there SHOULD have been a SELinuxTroubleShooter gold star giving you an error and fix

turn SELinux back on and write a new rule for your moved $HOME folders
you might also have to rewrite a good chunk of the system files to use this different home folder .
 
Old 08-11-2011, 08:31 AM   #7
gabriel.560
LQ Newbie
 
Registered: Jan 2009
Posts: 17

Original Poster
Rep: Reputation: 0
We are migrating from an old hp unix server. The users home directories are under /users. We want to keep the new server as close as possible to the old one, since there are many scripts and programs that depend on the current directory layout. Disabling SELinux is just a temporary solution to allow users to log in and perform tests, i won't leave it like that.

Thanks for you help.
 
  


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
NFS problem: "Could not chdir to home directory /home/USER: Permission denied" sumanc Linux - Server 4 07-22-2010 04:12 PM
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 04:02 PM
printer setup from Centos 5 to Vista home prem. on a headless centos pc ncsuapex Red Hat 6 03-10-2008 11:40 AM
Home network problem - Centos - no route to host dralexpe Linux - Networking 2 06-30-2007 05:43 PM
Put a 2nd kanotix at hdb 3/,-4/home. 1st is at hdb8/,-9/home.#2 is using 1st's /home sleekmason Linux - General 3 12-09-2006 09:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:30 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
Open Source Consulting | Domain Registration