LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-17-2008, 08:40 PM   #1
teaser
LQ Newbie
 
Registered: Jul 2008
Posts: 4

Rep: Reputation: 0
Moved ALL libraries from /lib to /local/


I inadvertently did the following:

mv ../lib* .

from
/local

(which really means - all files inside /lib/ got moved to /local/)

.. and now I CANNOT get into the box. 'Access Denied' as a root or a regular user. However, I still have the currently running SSH session, which doesn't let me do much - except for cd, pwd, echo and couple other basic commands (no cp, mv, ls etc). Can't sudo either (not that it would help much). Please advise! I don't have physical access to this box; it's few hundred miles away. RHEL 5. Thanks!!!
 
Old 07-17-2008, 09:24 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
One of the libraries that you have renamed is the PAM library. Without the PAM library being available then nobody will be able to pass through security, remote, local, or otherwise.

If the point of this question is to find out how to login remotely without knowing the password then you are out of luck.

--------------------
Steve Stites
 
Old 07-17-2008, 09:35 PM   #3
teaser
LQ Newbie
 
Registered: Jul 2008
Posts: 4

Original Poster
Rep: Reputation: 0
What do you mean by saying 'without knowing the password'? If PAM is a library that's been renamed (moved), where and how do I put in the password? The machine responds to ping, accepts SSH connections, asks for login and password, and goes 'Access Denied' -- even to root!
 
Old 07-18-2008, 06:37 AM   #4
FranDango
Member
 
Registered: Jun 2008
Posts: 101

Rep: Reputation: 15
If you still have that valid SSH connection that enabled you to move everything from the /lib/ directory to /local/ then do the reverse by COPYING everything from /local/ to /lib/ - you will have a lot of duplicate files, but at least both /lib and /local will serve their purpose properly. If your system becomes reliable again, then start sorting out what belongs where.

If your SSH connection breaks or is timed out, then you will have to travel a few hundred miles.

Linux Archive

Last edited by FranDango; 09-20-2008 at 05:10 AM.
 
Old 07-18-2008, 06:43 AM   #5
teaser
LQ Newbie
 
Registered: Jul 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by FranDango View Post
If you still have that valid SSH connection that enabled you to move everything from the /lib/ directory to /local/ then do the reverse by COPYING everything from /local/ to /lib/ - you will have a lot of duplicate files, but at least both /lib and /local will serve their purpose properly. If your system becomes reliable again, then start sorting out what belongs where.

If your SSH connection breaks or is timed out, then you will have to travel a few hundred miles.
Yes, but how do I copy? The CP command doesn't work!!
 
Old 07-18-2008, 06:44 AM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Can't you mount the partition from another machine? I imagine that there isn't much you can in this case except accessing the drive and doing repairs from some external location.
 
Old 07-19-2008, 11:08 PM   #7
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
You can run mv, cp , etc as following:
/usr/lib/local/ld-linux.so.2 --library-path /usr/lib/local /bin/cp args

Valery
 
Old 07-24-2008, 03:16 AM   #8
FranDango
Member
 
Registered: Jun 2008
Posts: 101

Rep: Reputation: 15
I'm just curious if it was possible (and how) to recover that system?

Linux Archive

Last edited by FranDango; 09-20-2008 at 06:11 AM.
 
Old 07-24-2008, 03:46 AM   #9
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by FranDango View Post
I'm just curious if it was possible (and how) to recover that system?
Sure.
/usr/lib/local/ld-linux.so.2 --library-path /usr/lib/local /bin/cp args
can be used to copy missing libraries back. May be mv will be OK too
 
Old 07-24-2008, 07:19 AM   #10
sir_com
Member
 
Registered: Feb 2008
Posts: 31

Rep: Reputation: 15
excellent...I didn't knew this.....it works
 
Old 07-25-2008, 08:19 AM   #11
teaser
LQ Newbie
 
Registered: Jul 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Valery Reznic View Post
You can run mv, cp , etc as following:
/usr/lib/local/ld-linux.so.2 --library-path /usr/lib/local /bin/cp args

Valery
Sorry - I was away from my machine for few days. Yes it worked on my test machine (when I was logged in as root); but on the production box that I did mv earlier, I had sudo'ed to root and had done mv; so the command didn't work with my permissions when I tried to move the libraries back. I needed to either be logged on as root, or be able to sudo (where /usr/sbin/sudo wasn't recognized any longer due to missing libraries and dependencies).

Thank you for the help - regardless. You guys are great!
 
  


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
I moved /lib !!! :( HELP! craiglinux Linux - Software 13 07-16-2012 10:05 AM
Removing .a libraries in /usr/lib/ kunkie Linux - General 1 08-27-2005 11:44 PM
I moved /lib. Oh my god it died!!!! wolfe2554 Linux - Newbie 3 04-13-2004 01:59 AM
g++ can't find libraries that are in /usr/lib williamtbranch Linux - Software 2 01-17-2004 01:28 PM
installing lib or libraries or *.so is not working laxguy1515 Linux - General 2 06-06-2003 09:48 PM

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

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