LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices

Reply
 
Search this Thread
Old 06-13-2010, 02:13 AM   #1
Nathan Spencer
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Rep: Reputation: 0
Exclamation Ran rm -rf on Home Directory unable to run commands as Root


Accidently ran rm -rf while the pwd was /home/user-name

Now I'm unable to run any command whatsoever as root, ls,vi,cnf whatever, they don't work.

However the commands work as normal user.

I can guess that the files with root ownership in the home folder were deleted but I would like to revert everything back to normal and would like to know how to solve this problem.
 
Old 06-13-2010, 02:43 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
well the two things don't make any sense as directly related issues, deleting a norml users home directory can not affect root, unless your system is already horrendously ill. You also havne't said anything about how they don't work... error messages etc. The only thing I can directly think of is your PATH statement somehow not existing, which still doesn't match your actions in the slightest.
 
Old 06-13-2010, 03:43 AM   #3
Nathan Spencer
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
well the two things don't make any sense as directly related issues, deleting a norml users home directory can not affect root, unless your system is already horrendously ill. You also havne't said anything about how they don't work... error messages etc. The only thing I can directly think of is your PATH statement somehow not existing, which still doesn't match your actions in the slightest.

Thanks for Replying.

Let me try to vividly explain what I did.
I was logged into directory : /home/user

I switched to root, typed this:
Code:
linux:/home/user# rm -rf foldername
It seems that the foldername i typed was non existent, the actual name of it was /foldername (Which Still exists btw)

Now,
Here's what I get after I run commands (As Root):
for e.g :
Code:
linux:/home/user#ls
If 'ls' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf ls
The above applies for all the commands, I run as root now. Ran env, it returns the same message stated above.

That's the usual message that pops up whenever something's not installed, right?

However when I run commands as normal user, they work.



And Yes, I was messing with the path statement, editing the /etc/skel/.bashrc, /home/user/.bashrc, /etc/bash.bashrc. I was just setting new paths for installing a compiler(added line :export PATH:$PATH:$DIRBIN). Nothing else. Now, I undid the changes. The problem persists.
What might be the solution?
 
Old 06-13-2010, 04:07 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
well it does feel like a path issue, what if you run /bin/ls directly, and also run "echo $PATH" to show what you currently have.
 
1 members found this post helpful.
Old 06-13-2010, 04:18 AM   #5
Nathan Spencer
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
well it does feel like a path issue, what if you run /bin/ls directly, and also run "echo $PATH" to show what you currently have.
As Root, echo $PATH gives:

Code:
linux:/home/user # echo $PATH
:
linux:/home/user #
As Root, /bin/ls lists directories and files present.

As user, echo $PATH gives:
Code:
/home/user/bin:/home/user/bin:/usr/lib64/mpi/gcc/openmpi/bin:/home/user/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/opt/cross/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/home/user/go/bin:/home/user/go/bin
As user, /bin/ls lists the directories and files present.

Perhaps, the root's $PATH is messed up?


EDIT:

I have resolved the problem.
As acid_kewpie rightly pointed out, it indeed was a Path issue.

I switched to root, set path via
Code:
linux:home/user #export PATH=/home/user/bin:/home/user/bin:/usr/lib64/mpi/gcc/openmpi/bin:/home/user/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/opt/cross/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/home/user/go/bin:/home/user/go/bin
and Voila, its back to normal again.

Thanks again to acid_kewpie for pointing out the root cause.

Last edited by Nathan Spencer; 06-13-2010 at 06:46 AM. Reason: Issue Resolved
 
  


Reply

Tags
rm, root, suse


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
[SOLVED] How to allow access to some commands having root privleges to be run bu non root user suryashikha Linux - Newbie 8 10-31-2009 02:05 PM
restoring desktop directory in /root (or any home directory) mel_lai Linux - Newbie 3 02-04-2008 04:13 AM
Ran Firefox as root, now can't run as user! mazinoz Linux - Desktop 1 01-13-2007 04:16 AM
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 03:37 PM


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