LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 11-05-2007, 02:32 AM   #1
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 183

Rep: Reputation: 30
Cannot login as root


Hi,

I have the following weir error.I try to ssh into one of my servers as root.I successfully log in,but where i'd expect to see something like

root@localhost:

i see

-bash-3.1

So i do not have full root privaleges.I only have some kind of bash shell.For instance if i try to cd /root,it says no such directory,su does not work as well.

Code:
-bash-3.1# cd /root
-bash: cd: /root: Not a directory
-bash-3.1# su
bash: /root/.bashrc: Not a directory
Any idea what can cause this,and how i can fix this to give me proper root login.

Thanks
 
Old 11-05-2007, 03:11 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,397

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
no reason to think you aren't fully root, that prompt is just symptomatic of having no /root directory, where the root users .bashrc file would be. is /root a seperate partition? anything in dmesg and /var/log/messages? is everything actually dying on it's feet and you've not noticed? is there a chance you could have been compromised via a rootkit of something?
 
Old 11-05-2007, 03:30 AM   #3
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 183

Original Poster
Rep: Reputation: 30
Hi,Thanks for the reply.

/root is not a seperate partition no.I just used the default partioning for Fedora Core 6.

I can't see anyone hacking into the box,It was only switched on two days ago,and the only access to it is through our local network.

I can't really see anything on /var/log/messages that looks funny.What can cause this kind of thing,I don't believe the box is dying,its working fine,doing what it must,its just the /root folder that's missing.

Also,i've noticed the root folder is present

Code:
bash-3.1# cd /
bash-3.1# ls
bin  boot  dev  etc  home  lib  lost+found  media  misc  mnt  net  opt  proc  root  sbin  selinux  srv  sys  tmp  usr  var  webmin-setup.out
bash-3.1# ls -lh root
-rw-r--r-- 1 root root 147 Jul 12  2006 root
So the file is there,but it does not seem to be a folder?

Is there anything i can do to restore my /root and have the box displaying the root@localhost instead of the bash-3.1 ?One guy suggested a reinstall,but surely i can fix this in another manner?

Last edited by baddah; 11-05-2007 at 03:36 AM.
 
Old 11-05-2007, 03:54 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,397

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
oh god, no don't reinstall. so what happened... erm user error maybe? i guess it's possible that a file inode could have got corrupted and then interpreted /root as a file not a directory, but I'm afraid by default i'd err towards a mistake. either way, by default there is nothing interesting in there. delete the file, or rather rename it to somethign benign until you're sorted, and then create a new /root, and copy the contents of /etc/skel into it. log in again and you should be sorted.
 
Old 11-05-2007, 05:21 AM   #5
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 183

Original Poster
Rep: Reputation: 30
HI,

Thanks,Its looks much better now.I'm getting the root@server now.I was not aware of this /etc/skel directory.Quite cool.I'll monitor the box a bit,and see if there's any problems.

I probably did something wrong to cause this i'm sure.Just don't have a clue what that was,but thanks for all the help.
 
Old 11-06-2007, 09:02 AM   #6
nomb
Member
 
Registered: Jan 2006
Distribution: Debian Testing
Posts: 675

Rep: Reputation: 58
This is a little off topic, but it is a good idea not to allow root to login directly. Go into sshd.conf and change:

PermitRootLogin Yes
to
PermitRootLogin No

The, when you want to login as root login as a regular user and 'su -' to become root.

nomb
 
  


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
Adding root privaliges to user accounts or auto login as root Val-Ent Linux - General 15 03-02-2010 04:27 PM
wrong login shell prevent root login cefs99 Linux - Security 4 05-31-2006 08:28 AM
Gnome: Cannot login as default user, sends back to login, works as root Danny-T Linux - Newbie 2 05-27-2006 03:44 AM
I have re-installed MK 9.2 but cannot login as user, login as root works. bobinglis Mandriva 2 02-22-2004 11:39 AM
can only login as root? user login doesnt work..? anyone? hacking_4_b33r Linux - General 1 02-05-2004 11:40 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration