-2

How can I prevent my OpenSSH client from printing its version string when someone connecting with ssh -v (verbose mode)?

I don’t want this version banner to be printed during verbose mode. I’ve searched and found that this version string is part of the SSH protocol and not easily configurable.

ssh -v [email protected] :

OpenSSH_9.6p1 Ubuntu-3ubuntu13.14, OpenSSL 3.0.13 30 Jan 2024
debug1 ...
8
  • 2
    Hello there, I'm a bit curious why do you want to do this, is it a countermeasure against app version reconnaissance? Commented Dec 16, 2025 at 8:34
  • You cannot AFAIK. Commented Dec 16, 2025 at 8:40
  • This is just an exercise to get more familiar with Linux and binaries. I think it can also be useful for not disclosing the version. @td211 Commented Dec 16, 2025 at 9:19
  • 1
    Are you sure that's the server's banner? Ona few systems I checked (macOS, Arch, Ubuntu) that first line of ssh -v has always been the client's version. There are lines which show the server's version, but they look like debug1: Remote protocol version 2.0, remote software version OpenSSH_9.6p1 Ubuntu-3ubuntu13.14, debug1: compat_banner: match: OpenSSH_9.6p1 Ubuntu-3ubuntu13.14 pat OpenSSH* compat 0x04000000, etc. Commented Dec 16, 2025 at 11:26
  • 6
    This request is a little strange: if you don't want verbose output, don't use the -verbose flag. This is the local ssh version, so anyone who can run it is already logged in, already has access, can already run ssh -V to get the same thing, so if you don't want it, just don't use -v and that's it. There's no security issue here. Commented Dec 17, 2025 at 11:29

1 Answer 1

0

I solved this by modifying the OpenSSH source code and changing the version string in version.h, then rebuilding OpenSSH.

2
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. Commented Dec 17, 2025 at 12:52
  • Thank you very much, I will definitely check and edit my answer.@Community Commented Dec 18, 2025 at 11:22

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.