Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Linux Security: Help I have lost SSH access to my server

Posted on 2013-06-15
6
Medium Priority
?
824 Views
Last Modified: 2014-07-16
Dear Experts,
I have a stand alone server hosted by an external company.

Linux CENTOS.

We have suddenly lost SSH access.  We also cannot login with the root password through cPanel control panel.

We are told all the files and folders have been changed to the permission 777 which "breaks" the server.

Is this the final story or is there any way to get back control of the server?
Best Wishes,
Phil
0
Comment
Question by:PTRUSCOTT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 31

Expert Comment

by:farzanj
ID: 39249791
You should use Putty to access your server via command line.

Yes, 777 is not just a terribly bad idea but if it can break many things.   In particular, if you have public-private key mechanism enabled, it would quit working if your .ssh folder and/or files in it have world write permissions.  They have to have as restrictive permissions as possible.

Certain other mechanisms like SELinux also disble access if permissions are too open.
If you made 777 for everything on the server, you need to either get backup to the old settings or if you don't have a good backup, reinstall anyway.

See if it would manually let you access though command line or through console.
0
 
LVL 1

Author Comment

by:PTRUSCOTT
ID: 39249815
When I try to use PuTTY.esxe with the old settings (root user name) and port 22.

I get the following error message:

PuTTY fatal error message:

"Server Unexpectedly closed network connection"

Is there some PuTTY configuration to get accesss in this situation?
Best Wishes,
Phil
0
 
LVL 31

Expert Comment

by:farzanj
ID: 39249820
Do you have any other user besides root that you may use to login?  Once you get into the system, you can change user.

You need to use some utility to see if ssh is even up.  Do you have a Linux client or only Windows?

Use telnet to see if the port is advertised.
telnet server.com 22

Ping the machine to see if it is even running.
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 79

Expert Comment

by:arnold
ID: 39249836
Console access is the only way.  Does the remote provider have an IP KVM that can be used to access the console?
Depending on the system maker, does it have DRAC, ILOM, LOM type of access?
It had to have been configured and the remote provider would ........

Can you go on site?

The remaining option is either have their support staff work on it if available, r have the system shipped to you,
0
 
LVL 21

Accepted Solution

by:
Mazdajai earned 2000 total points
ID: 39249977
As other experts have mentioned, your only option is to try ssh in with other users and su to root.

But in the end the box still require a reinstall from a console because it is nearly impossible to fix the permission.
0
 
LVL 21

Expert Comment

by:tfewster
ID: 40200795
Reinstall and restore from backups is probably the quickest way, But for info - rpm can restore ownership and permissions of OS files:

for RPM in $(rpm -qa); do rpm --setugids --setperms $RPM; done

Open in new window


But to be able to do that you have to log in and I think the login program needs to be setuid root which `chmod 777` will have broken. You may be able to get in in single-user mode, or boot from CD and fix enough program permissions to log in.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question