Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


SSH login with password disabled & private key lost?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

SSH login with password disabled & private key lost?

I re-install my PC and my private key is lost. My VPS has disabled SSH login by password which I'm not sure it affect normal user or root as well.

Is there any way to login again???

Comments

  • Do you have access to the console of your VPS?

  • If you have OpenVZ and SolusVM, you should be able to open up an emergency console in SolusVM.

  • AzureVPSAzureVPS Member
    edited February 2014

    If you for some reason don't have a way to access the VPS's console, your next best bet would be to open a support ticket to your provider asking kindly for them to re-enable password logins and reset your VPS password; or add your new public key.

  • said: My VPS has disabled SSH login by password which I'm not sure it affect normal user or root as well.

    It affects all users (incl. root).

  • Not necessarily true. He could of only disabled password logins for root but kept then enabled for all other users. Depends what change OP made in sshd_config

    Thanked by 1vRozenSch00n
  • Mark_RMark_R Member
    edited February 2014

    Your provider should be capable of accessing your VPS no matter what, you better contact them and ask if they can undo what you did.

    If they respond with that they cannot do it or anything like that then you should consider switching hosts because that would be either a lie or they are very lazy.

  • OkieDoke said: Not necessarily true. He could of only disabled password logins for root but kept then enabled for all other users. Depends what change OP made in sshd_config

    Yup, he could. But, I think, that OP just added to sshd_config line "PasswordAuthentification no".

  • MonsteRMonsteR Member
    edited February 2014

    If this is a dedicated Server or KVM you can reset the password via the kernel you can see more details here, http://www.outsidaz.org/blog/2007/10/22/resetting-root-password-via-grubkernel-boot-options/

    Also if your disabled password login you should edit /etc/ssh/sshd_config
    PasswordAuthentification yes
    root login permitted yes
    etc

  • Who's your proivder? Check if they have VNC access to your VPS. It's usually in the control panel, but if it's not contact the provider.

  • Or boot from a live linux cd, mount it and replace the ssh keys with new one.

  • @fileMEDIA said:
    Or boot from a live linux cd, mount it and replace the ssh keys with new one.

    That's implying he has some form of remote VNC/serial, where he could change the keys without booting into a live CD.

  • I think I disabled password for all users as I tried to login with root and normal account but still no success. When I tried to run VPC console, i got unsigned error from Java :(

    My hosting provider is @ramnode. I submitted a ticket and waiting for their reply...

  • Use the connection info from the console to login with an ssh client and replace the key. Assuming you are trying to use the java-based ssh client, of course.

  • DewlanceVPSDewlanceVPS Member, Patron Provider

    You can ask to your hosting provider to unlock or fix your SSH issue.

  • I just tried also in ramnode solusvm, you can create a serial console and use ssh to login with the provided address/port/username/password, no need to use java

  • BrianHarrisonBrianHarrison Member, Patron Provider

    @fileMEDIA said:
    Or boot from a live linux cd, mount it and replace the ssh keys with new one.

    That option is most likely not appropriate/not available to him.

    If you can remember your password, you'll be able to login via console without any issues. If you can't remember your root password, your host will be able to reset it for you unless you're running Xen HVM with a mounted ISO.

  • @MichaelBui said:
    I think I disabled password for all users as I tried to login with root and normal account but still no success. When I tried to run VPC console, i got unsigned error from Java :(

    My hosting provider is ramnode. I submitted a ticket and waiting for their reply...

    Okay, we're getting somewhere... click on the VNC console link. The window will open and it will ask you to run Java plug-in - try and run it but if it does not work you don't have to. Follow these steps:
    Check the source of the pop-up window which requires VNC Java Applet plug-in; it should have the details of your VNC connection; also the VNC connection details may be listed in the VPS management console; you will need:

    • IP Address of the VNC server, which usually is not an equivalent of your box IP address
    • VNC port, e.g. 5914
    • VNC password, which you may request to be reset through the VPS management panel

    Download the latest version of TightVNC from: http://www.tightvnc.com/
    Install the client component only. Start a new connection and try to get to your VPS console window. Good luck!

    Let me know if worked for you.

  • Thanks @lewekleonek a lot! You solved my problem :)

Sign In or Register to comment.