Comments

Thursday, January 24, 2013

Secure SSH with knockd Debian

Posted by at Thursday, January 24, 2013 Read our previous post
If you want to Secure your OpenSsh Server,i think the best way are using knockd.
Knockd HomePage

What you need is only a Debain Sever with OpenSSHD.
  1. Upload my BashScript to your Root Server.
  2. chmod 0777 scriptname.sh
  3. ./scriptname.sh
  4. Get Some Knockd Client from the HomePage
  5. Send your Magic Packets 666 999 2222 to your Root with the Client Now Kockd will start Your SSH Server on the Debain Root Server.
  6. Knockd Client Sample :
     
     
    knock myserver.example.com 666:tcp 999:tcp 2222:tcp
    knock -u myserver.example.com 666 999 2222 
     
My AutoScript:
// Comment

#!/bin/bash
# by cr4shyyy Auto knockd

#Install knockd
apt-get install knockd 
cat /dev/null > /etc/default/knockd
cat /dev/null > /etc/knockd.conf

#conf AutoStart
echo START_KNOCKD=1 >> /etc/default/knockd

#conf knockd.conf
echo [options] >> /etc/knockd.conf
echo        logfile = /dev/null >> /etc/knockd.conf
echo "" >> /etc/knockd.conf
echo [opencloseSSH] >> /etc/knockd.conf
echo sequence = 666,999,2222 >> /etc/knockd.conf
echo seq_timeout = 35 >> /etc/knockd.conf
echo tcpflags = syn >> /etc/knockd.conf
echo start_command = /etc/init.d/ssh start >> /etc/knockd.conf
echo cmd_timeout = 30 >> /etc/knockd.conf
echo stop_command = /etc/init.d/ssh stop >> /etc/knockd.conf

#Portknockd restart
/etc/init.d/knockd restart

#Disable ssh@ boot
update-rc.d ssh disable

#Stop sshd
/etc/init.d/ssh stop

1 comment:

[#] iNFO [#]

All the information provided on this site is for educational purposes only.
 
The site and it's author is in no way responsible for any misuse of the information.
©2012 Security is just an Illusion is powered by Blogger - Template designed by Stramaxon - Best SEO Template