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.
no no i know for sshd banner.
I dont want to some kiddi with nmap get my ssh server version.
with nmap i get this
22/tcp open ssh OpenSSH 3.8.1p1 Debian-8.sarge.4 (protocol 2.0)
Usually this kind of tweak you need to make in the source code for the application itself.
It is a server identification string, some servers (e.g. apache) have config options that allow you to modify the amount of information you show is this string.
Did you make a copy of the old sshd?
And you have put your version?
There is a mistake in the above line, should be:
Code:
sed -i 's/OpenSSH_4\.2p1 Debian/AwayAwayAwayAwayAway/' /usr/sbin/sshd
Take a new binary, launch strings on sshd
strings `which sshd` | grep -i debian
and do the operation as above, replacing . by \.
Worked on my sshd, the cleanest would be to recompile.
I don't think its really usefull to hide your version. Better tighten your security than hiding.
i have done sed -i 's/OpenSSH_4\.2p1 Debian/AwayAwayAwayAwayAway/' /usr/sbin/sshd but ....
root@argo:~# nmap -sV 192.168.0.2 -p 666
Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2006-05-12 08:41 CEST
Interesting ports on argo.ath.cx (192.168.0.2):
PORT STATE SERVICE VERSION
666/tcp open ssh OpenSSH 3.8.1p1 Debian-8.sarge.4 (protocol 1.99)
Nmap finished: 1 IP address (1 host up) scanned in 0.149 seconds
What I gave was an example. I'm not sure you really understand the command sed
sed replaces something with something else
I was running OpenSSH_4.2p1 so I replaced OpenSSH_4.2p1 by some junk. For you its something else!
To get the correct string, type this:
(1)
Code:
strings `which sshd` | grep -i debian
then to get the number of chars to replace do this
(2)
Code:
strings `which sshd` | grep -i debian | wc -c
Then issue:
sed -i 's/your version/Junk/'
WHERE
"your version" is the result of (1) after having replaced . by \.
"Junk" has to be a text of your choice of length [result of (2) - 1 ] So if (2) gave 21, then you have to put a text of length 20: AwayAwayAwayAwayAway in my case.
then restart sshd and check
If you are wrong, you've corrupted your ssh, so keep a backup
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.