Results 1 to 6 of 6
HELP!!!
I get this error when I try to log in to our Centos server as root. Does anyone know how to fix this? The /root directory is not there. ...
- 10-31-2008 #1Just Joined!
- Join Date
- Oct 2008
- Posts
- 4
[SOLVED] Could not chdir to home directory /root
HELP!!!
I get this error when I try to log in to our Centos server as root. Does anyone know how to fix this? The /root directory is not there. Logging in as a different user works.
Could not chdir to home directory /root: No such file or directory
-bash-3.2#
Thanks,
DB
- 10-31-2008 #2Just Joined!
- Join Date
- Oct 2008
- Posts
- 4
I also get this error when exiting from a vim command (this may be related).
E138: Can't write viminfo file /root/.viminfo!
Press ENTER or type command to continue
- 10-31-2008 #3
Root's home directory is missing. You can recreate it with 'mkdir /root', but it'll be empty.
Normally, you should not log in directly as root. All direct root access should be disabled for remote logins and X sessions, although allowing root access from text-mode terminals can be a lifesaver when things go wrong. You should always log in as a real user and then use 'su' or 'su -' (and the root password, of course) to change to the root user.Linux user #126863 - see http://linuxcounter.net/
- 10-31-2008 #4Just Joined!
- Join Date
- Oct 2008
- Posts
- 4
Thanks Roxoff.
I did tried recreating the /root directory. When I log in as root, I don't get that message anymore but my command line still starts out with
-bash-3.2#
instead of
[root@server~]$
Is something missing?
- 10-31-2008 #5
Yes, you've got some default files missing. There are a set of user defaults in /etc/skel (or similar - I'm sorry I forget the exact place, and I'm at work using Windwos at the moment, so I cant look).
The files you need are the default .bash_profile and .bashrc, these should be copied into /root. The leading '.' means the files are hidden, so you might have to do 'ls -a' to see them.Linux user #126863 - see http://linuxcounter.net/
- 11-03-2008 #6Just Joined!
- Join Date
- Oct 2008
- Posts
- 4
That worked. Thank you so much!



