NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
madtulip
Mar 23, 2015Aspirant
Locked myself out of ssh ...
Hello. I just did stupid :/. I edited /etc/ssh/sshd_config and instead of restarting the ssh service i rebootet the box. Seems there was a typo or something else wrong. now i cant ssh into the b...
madtulip
Mar 27, 2015Aspirant
well i cant check, i dont have ssh access anymore after saving a typo to /etc/ssh/sshd_config and rebooting.
i found an smb folder shared for the admin acount called /Scripts in which Backup.sh is located. i suspected that Backup.sh is executed by the cron job daily so i edited it to contain.:
i then placed the new vanilla code you gave me in a file created by the admin account via smb in /c/sshd_config in the hope that cron gets executed "as root" (?) and copies the vanilla file to the correct location so that i can afterwards boot the box to have the vanilla file loaded.
so far the broken sshd_config did not appear in /c/backup/sshd_config (also visible as smb share) so i guess that /Scripts/Backup.sh is not executed by cron at all. maybe /Scripts is just a backup of the scripts themselves or cron doesnt trigger it or maybe it only does once per week instead of once per day as my description in the file suggests. i could wait longer to see if it triggers at some point.
i found an smb folder shared for the admin acount called /Scripts in which Backup.sh is located. i suspected that Backup.sh is executed by the cron job daily so i edited it to contain.:
# save the broken version of the file
cp /etc/ssh/sshd_config /c/backup/sshd_config
# overwrite the broken file with the new vanilla version
cp /c/sshd_config /etc/ssh/sshd_config
i then placed the new vanilla code you gave me in a file created by the admin account via smb in /c/sshd_config in the hope that cron gets executed "as root" (?) and copies the vanilla file to the correct location so that i can afterwards boot the box to have the vanilla file loaded.
so far the broken sshd_config did not appear in /c/backup/sshd_config (also visible as smb share) so i guess that /Scripts/Backup.sh is not executed by cron at all. maybe /Scripts is just a backup of the scripts themselves or cron doesnt trigger it or maybe it only does once per week instead of once per day as my description in the file suggests. i could wait longer to see if it triggers at some point.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!