LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 09: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, 10:24 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,751

Rep: Reputation: 272Reputation: 272Reputation: 272
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, 10: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, 07: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 06:10 AM.
 
Old 07-18-2008, 07: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, 07:44 AM   #6
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
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-20-2008, 12:08 AM   #7
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 675

Rep: Reputation: 136Reputation: 136
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, 04: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 07:11 AM.
 
Old 07-24-2008, 04:46 AM   #9
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 675

Rep: Reputation: 136Reputation: 136
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, 08: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, 09: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


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


All times are GMT -5. The time now is 12:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration