Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how would you set up a dummy ssh port 22 that looks like a real ssh port? My real ssh port is hidden and I don't want hackers to search for it, so I'm thinking about setting up a dummy port 22. How would I do that? Thanks in advance.
Well, you can make a copy of OpenSSH, then throw out all the useful stuff. Set up OpenSSL to always reject the connections.
Another option is to simply listen on that port with a maximum queue of "0" - I think that's valid and refuses all connections. If I'm mistaken then "0" means "max permissible". In this instance the "connection refused" message at the remote end is suitably vague - there could be any number of reasons for it. Of course someone who actually looks at the packets will see that there is never any SSL traffic and might suspect that there isn't even an SSH server there.
I'm not sure a dummy port would help you in the least; the script kiddies' toys poke at ports until they find something; of course in that case 'snort' might help you out.
1. Use an iptables TARPIT on connections to tcp/22
2. If you use xinetd, set it as a sensor port. That will at least block them from another other service they might look at:
service ssh
{
flags = SENSOR
type = INTERNAL
socket_type = stream
wait = no
user = nobody
deny_time = 45
}
Then the real one would need a 'secret-ssh' added to /etc/services on the port you want it to be hidden on:
service secret-ssh
{
instances = 10
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/sshd
server_args = -i
}
3. You could write a little script to just echo out some OpenSSH type text when the port is hit. Stick it in inetd/xinetd at the right place.
I moved my ssh port years ago, and never once had it messed with since, so I wouldn't worry a whole lot about someone going looking for it once the usual place turns up fake/empty. Most ssh-scanning is done by automated scripts/tools, as far as I can tell.
Last edited by jayjwa; 06-19-2008 at 02:54 AM.
Reason: spelling errors
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.