LinuxQuestions.org
Review your favorite Linux distribution.
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 08-10-2010, 03:37 AM   #1
Inhumed
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Rep: Reputation: 0
Cannot log in, home directory not recognized?


Hello linuxquestions,

I have tried googling many times for answers, but haven't yet found a solution to my problem (maybe its my selection of search terms).

I screwed up my debian system by trying to setup an ftp server with vsftpd very quickly without reading much documentation (very stupid) as root. I must have screwed up the something to do with the home directory for my user because now I cannot even log in with my usual username and password when the computer starts up. All the computer says when I try to log in is:

Unable to cd to 'home\myusername'

I can log in as root with Debian single user mode, so I am hoping I can reset my home directory so it works again. Also, I cannot seem to ever get the gnome login screen just a terminal login screen.

Does anybody know of anything that might help this problem get solved?
Any help or direction to documentation or answers is appreciated!

Thank you,
Inhumed

Last edited by Inhumed; 08-10-2010 at 03:38 AM.
 
Old 08-10-2010, 03:42 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

This looks wrong: home\myusername, shouldn't that be home/myusername (linux uses forward slashes).

If that is the problem, have a look at the /etc/passwd file and correct this.

To give a correct example:
lfs:x:1000:1000::/home/lfs:/bin/bash (all forward slashes!, the bold part is what you probably need looking for.

Hope this helps.
 
1 members found this post helpful.
Old 08-10-2010, 03:55 AM   #3
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
by default home directory not created when you create user in debian.

you have to use -m -d option to create home directory when you create user.

Code:
useradd -m -d /home/test test
to resolve your problem just create home directory of user and give permission

Code:
mkdir /home/test
chown username:username /hom/test
chmod 755 /home/test
user your username in place of test

HTH
 
1 members found this post helpful.
Old 08-10-2010, 04:07 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
@sem007:
Quote:
by default home directory not created when you create user in debian.
That is only true if you use the useradd command (as in useradd user). Both the gui and adduser _do_ create the home directory........

The OP did not mention how the user were created assuming that useradd was used might not be a good idea without mentioning the other possibilities.

Hope this clears things up.
 
1 members found this post helpful.
Old 08-10-2010, 04:32 AM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
By logging in to root user, you can check if your home directory exists and all the permissions are correct apart from druuna's advice.
 
Old 08-10-2010, 04:43 AM   #6
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Quote:
Originally Posted by druuna View Post
@sem007:
That is only true if you use the useradd command (as in useradd user). Both the gui and adduser _do_ create the home directory........

Hope this clears things up.
Oh yes druuna I assume that OP use useadd command.

thanks
 
1 members found this post helpful.
Old 08-10-2010, 05:10 AM   #7
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Inhumed,

Quote:
I screwed up my debian system by trying to setup an ftp server with vsftpd very quickly without reading much documentation (very stupid) as root. I must have screwed up the something to do with the home directory for my user because now I cannot even log in with my usual username and password when the computer starts up. All the computer says when I try to log in is:
It is thus assumed here that you have once or many times previously logged as ordinary user and cd'd into your /home/sweethome folder.

Also, assumed here that your vsftpd daemon is already running.

So I just thought:

To make it easier stop the vsftpd daemon first --

a) (use the init.d script at the /etc/init.d/ --I am not sure how is it implemented with Debian just browse the /etc;

b) or you can kill the vsftpd process,
--# ps axu | grep vsftpd
then --# kill PID {vsftpd}

After that try to login from a tty# (press Ctl+Alt+F3-5) as ordinary user and find out if you can get into your /home/sweethome. If not then go back to your root session (press Ctl+Alt+F7), using a cli issue commands:

--# chown -R inhumed:users /home/sweethome
--# chmod -R 775 /home/sweethome

then go back to your tty3 (press Ctl+Alt+F3) login as ordinary user and we now hope you are back to your /home/sweethome. If lucky, go immediately, review your vsftpd.conf and check out where you messed it up. There are good tutorials for that here and there.

Hope it helps. Good luck.
 
1 members found this post helpful.
Old 08-10-2010, 04:17 PM   #8
Inhumed
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you malekmustaq,druuna,sem007 and linuxlover.chaitanya for your replies. I will try some of these suggested tips and will get back to you if I can get anything to work again .

EDIT 1: For clarification, the slash I wrote was backwards as druuna pointed out. I always forget which way it is since I switch between linux os and windows os. I also have logged into the debian os many times before this problem as this user.

EDIT 2: It is now back to normal thanks to the chmod command! I tried

"chmod 755 /home/myusername"
and it didn't work so I tried
"chmod 755 /home/" and "chmod 755 /"
and that worked. Now I get the gdm and can login fine

Thank you
Inhumed

Last edited by Inhumed; 08-10-2010 at 05:00 PM.
 
  


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
"Home directory already exists. Please enter another home directory path." Daravon Ubuntu 2 02-15-2009 10:26 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
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 02:37 PM
Home directory missing! cannot log-in? orranview Linux - Newbie 3 03-15-2004 06:15 AM
Non-root users can log in to SSH but not read Home Directory? Bizanshee Linux - Software 1 09-18-2002 07:01 PM

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

All times are GMT -5. The time now is 09:50 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