Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was trying to get my dedicated server to have a couple of VPS's installed using this tutorial: http://linux-vserver.org/Installation_on_CentOS

In the process I had to change a file: /etc/ssh/sshd_config

The documentation advises to change it into:

ListenAddress <host IP address>

Guess what? I literally added <host IP address> instead of the dedicated servers IP. I restarted the server and now I'm not able to access my SSH anymore. Can anyone help me to gain access to my SSH again?

I'm using CentOS 6.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

The problem here is that sshd fails to start due to invalind configuration.

You have to ask your dedicated server hosting provider if they have a way to attach a network accessible console to the server.

This way you can use the console to fix your sshd_config, and then restart sshd.

If your hosting provider does not have remote console available, then you have to give them your credentials so they can fix the sshd_config.

To mount the root partition, you need to know the partition setup. If you don't already know about it, you can find the information with fdisk -l.

This gives out a list of partitions available on all hard disks. Then, you should be able to find out where the root partition is.

Then you can mount root partition with this command:

mount /dev/sda1 /mnt

This assumes root partition is in first hard disks first partition, so replace /dev/sda1 with the proper partition.

If you have Linux software RAID in use, then the first parameter is /dev/mdX, where X is the number of the MD device.

If you have LVM in use, then the first parameter is /dev/mapper/LVMLABEL. Here you can find LVMLABEL by using lvs command.

share|improve this answer
1  
Depending on the hoster, they might offer rescue systems you can boot into to fix this. In the best case, it's a real server with built-in remote management. –  SvW Jun 8 at 16:38
    
Good addition, thanks! –  Tero Kilkanen Jun 8 at 16:40
    
They do, I started the server in rescue mode. But how do I mount it or something so I can get my system files and change the sshd_config back? (OVH btw) –  Arnold Jun 8 at 16:55
    
Thank you! I'm rebooting my server now I its fixed. –  Arnold Jun 8 at 17:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.