Howdy, Stranger!

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


What are common mistakes admin makes his Linux remote server inaccessible via SSH?
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.

What are common mistakes admin makes his Linux remote server inaccessible via SSH?

Hello,

which common mistakes leads into state where admin of the remote linux (Ubuntu, CentOS) server cant access it via SSH? I mean even reboot do not help to gain access.

So we made some checklist and maybe write a script that would fix the things if they are broken.

Thank You

Comments

  • hostnoobhostnoob Member
    edited April 2016

    wat

    how would a script/checklist help if you can't gain SSH access?

  • exception0x876exception0x876 Member, Host Rep, LIR

    ok here is the script, assuming you stored backups of the necessary files in the /backup directory. since you can't run the script (remember, you have no SSH access!), you need to create some way to execute it remotely.

    WARNING, it is made mostly for fun, not for the real world usage. Use it at your own risk!

    #!/bin/bash
    
    yum install openssh #replace with package manager command for your OS, this is in case you deleted SSH server
    cp /backup/sshd_config /etc/ssh/sshd_config #in case you messed up the config file
    setenforce 0 #in case you messed the SELinux policy
    cp /backup/authorized_keys /root/.ssh/authorized_keys #you could also delete your public key
    iptables -F
    service sshd restart #replace with the command for your OS
    

    I guess that covers the basics.

    Thanked by 1lukesUbuntu
  • Block port 22 lel.

  • Block port 22, open port xyz, changed sshd config but forgot to restart it lol.

  • Set no root login and not set ssh key, block port 22

  • MadMad Member

    Kick off himself due to wrong firewall rules.

  • maybe they did a rm -rf /

    its possible :) someone on serverfault posted an admin mistake http://serverfault.com/questions/769357/recovering-from-a-rm-rf

    Thanked by 1Crogic
  • Turn off password authentication but forget to add RSA key...then restart sshd

  • @grimsdottir said:
    Turn off password authentication but forget to add RSA key...then restart sshd

    Never close your current session down till you know you have a working setup :)

  • @AshleyUk said:
    Never close your current session down till you know you have a working setup :)

    You only do it once... ;)

    Thanked by 1raindog308
  • Change the permissions on your home folder to 777.

Sign In or Register to comment.