Knowledgebase

How reinstall ssh in rescue mode and start ssh

Posted by blogt, 01-23-2017, 05:21 PM
Hi To All My ssh on server is not working process is stopped ask host provider but they say i should fix issue in rescue mode i have not good skill for server management. How reinstall ssh and run on server when i am in rescue mode? Centos 6 64bit and directadmin panel Thank you for your help.

Posted by Hostinum, 01-23-2017, 05:59 PM
Has SSH actually been removed or it's just stopped? You need to identify this first. If it's been removed, then you need to ensure you have a network connection whilst in rescue mode and depending on your operating system (OS), assuming CentOS, you'd just run "yum install openssh" or similar compared to your OS. If it's just stopped, try to start it "service sshd start" or similar to your OS. If it starts and then stops then it's failing and you'll need to investigate why.

Posted by SneakySysadmin, 01-23-2017, 06:01 PM
If you can access the server while it's in "rescue mode" then by definition you have access to the console? Just log in using that console access and try to start the ssh service? If it doesn't start, fix its config. If it has been uninstalled and isn't there to be started then re-install it.

Posted by blogt, 01-23-2017, 06:28 PM
Stopped I have access to rescue mode when run "service sshd start" in rescue mode ssh started on main server?

Posted by blogt, 01-23-2017, 06:30 PM
Try start with directadmin but i have this error: Cannot find the script Details /etc/init.d/sshd

Posted by SneakySysadmin, 01-23-2017, 10:31 PM
If the initscript is gone then what the hell did you do to your machine? Try this: yum reinstall openssh-server openssh-clients If that succeeds then do:

Posted by MrTony, 01-23-2017, 11:39 PM
If this is OVH rescue mode, you cannot do this.

Posted by NortheBridge, 01-24-2017, 12:27 AM
Since "rescue modes" are self contained environments none of them will let you simply type "yum install 'x" to install a package onto the original system. It will install to the temporary rescue mode environment and be destroyed upon reboot. The best thing to do is to access the server's console through IPMI/iLO/iDRAC and run the commands suggested by a previous poster above. If for some reason you can't access IPMI then mount the server's disk as a a r/w disk in rescue mode, download the packages for OpenSSH to the mounted disk and maybe someone will have an idea of how you can install it. Honestly, without IPMI or SSH and without physical access to the server you have very little options unless DirectAdmin has a way to access the server console.

Posted by praland, 01-24-2017, 07:41 AM
To Start the installation use these commands on the command line # yum -y install openssh-server openssh-clients check the oport 22 # netstat -tulpn | grep :22 Check firewall configuration # vi /etc/sysconfig/iptables add this line -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT restart the ssh service # service iptables restart open ssh configuration # vi /etc/ssh/sshd_config Change all followings as you need Finally Save and restart the ssh service again to activate the new configuration # service sshd restart I think this might help you to re-install the SSH Server, Hope this will work for you.

Posted by blogt, 01-24-2017, 08:37 AM
is not working i can not install openssh via rescue mode on original system? i have hetzner dedicate server

Posted by blogt, 01-24-2017, 08:41 AM
How enable IPMI/iLO/iDRAC ? I can enable "VNC installation you can start the graphical installation"

Posted by MrTony, 01-24-2017, 09:41 AM
The rescue mode is not the same as the normal operating mode, it is very restricted for simple tasks such as file system manipulation in case of a disaster... so you first need to bring up your operating system to properly boot again, to only after make these installations or adjustments...

Posted by Mark-Hall, 01-24-2017, 10:07 AM
Why dont you ask the provide to give you access to IPMI or connect a KVM to your server in case it does not have any remote console on MB, so you can check it over console?

Posted by StealthyHosting, 01-24-2017, 10:48 AM
The easiest would be to use a kvm or IPMI to access the console of your main installed OS. If you absolutely must work with rescue system you should be able to mount the partitions and find the problem in your ssh config or chroot to the main OS and work with it.

Posted by SneakySysadmin, 01-24-2017, 11:37 AM
Have never used OVH - the only "rescue mode" I'm familiar with is the one you can access from the CentOS installation CD - so I presumed he had access to a remote console already. It is at this point in the narrative however that I fear we have wildly exceeded the competence of the OP. That's not to be taken as an insult - just given the contents of his post he's never done this and has no experience at it. So @blogt - you need remote console access to fix this. How you manage that we cannot know as we do not have the specifications of your server. It can be done with serial console over IPMI, a RAC (be it DRAC or MegaRAC or whatever) or via hardware KVM. Don't get hung up on the acronyms. All you need to do is contact your provider again and ask them what options for remote console are available to you with the server you have. They should be able to provide you with the details you need. If a remote console is not available, you'll need to ask your provider for admin assistance and have one of their people fix your server for you. They will charge you for this, but they'll also get it done a helluvalot faster and more reliably than you can.

Posted by parky1, 01-24-2017, 03:32 PM
You can install programs in a rescue mode if you mount the root partition and chroot. mount /dev/yourrootpartition /mnt chroot /mnt

Posted by blogt, 01-24-2017, 04:34 PM
after install open-ssh and service sshd start restart server and server can not boot i have this issue: Now i can not type in console this happened after a yum update How fix issue? sorry take your time Last edited by blogt; 01-24-2017 at 04:45 PM.

Posted by Afterburst-Jack, 01-24-2017, 05:09 PM
Quick question -- that looks like a KVM VPS. It looks like you're trying to boot off a mdraid device? (Your disk is probably "sda" or "vda")

Posted by NortheBridge, 01-25-2017, 04:03 AM
So this is a VPS; I very much doubt your boot device is /dev/mdX. The most common boot device is /dev/sda for RHEL based (you mentioned YUM) operating systems. Since this is a VPS it is likely /dev/sda which you need to boot off of. Fix that and you should be able to boot. If /dev/sda doesn't work try /dev/sdb and if that doesn't work you really need to take a look at your disk(s) layout so you can configure your VPS to boot from the proper device as there are a variety of available selections and us guessing won't help you.

Posted by blogt, 01-25-2017, 03:26 PM
Server is dedicate from hetzner i can pay $50 to fix my issue.

Posted by PaperWolv, 01-25-2017, 04:11 PM
Is this in software RAID? If so this might help you if you apply it as it applies to your partcular setup: http://pbraun.nethence.com/unix/sysu...nux/mdadm.html

Posted by hiabhilash, 01-26-2017, 08:08 AM
I don't understand your situation in full. But with hetzner rescue mode, you can simply restart the rescue mode and it should bring back the SSH. I believe you logged into rescue mode using SSH itself. Again, wow did the SSH stop ? In case you haven't seen this https://wiki.hetzner.de/index.php/He...scue-System/en . If Hetzner, will fix it for $50, I would advise to pay for it and get your server back online. In my experience with client's servers they usually don't over much support for your system, unless you are on managed servers where you also dont have root access.

Posted by HereHost, 01-26-2017, 09:38 AM
Dude if it is dedicated server just ask them for iMPI / iDRAC (KVM) so you can login and fix it by yourself or ask them to reinstall the ssh.

Posted by hakabe, 01-29-2017, 04:00 PM
You can order Lara (KVM) via https://robot.your-server.de Detailed information is in here : https://wiki.hetzner.de/index.php/LARA/en Request the fastest possible (for free).



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Leaseweb SBP Down? (Views: 625)
INTERSERVER DOWN (Views: 646)


Language:

Client Login

Email

Password

Remember Me

Search