Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

tmsh sshd banner-text multi line

I used to be able to do this with bigpipe, but now I can't figure out how to make a multi line banner text.  Can anyone point me in the right direction?
0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
Hi Nick,

This should get you going:

[root@ve4:Active] config # tmsh
root@ve4(Active)(/Common)(tmos)# edit /sys sshd all-properties

The command above will open the config section in the 'vim' editor. It will look like this:

modify sshd {
    allow replace-all-with { ALL }
    banner disabled
    banner-text none
    description none
    inactivity-timeout 0
    include none
    log-level info
    login enabled
}

You want to modify it to look like this:


modify sshd {
    allow replace-all-with { ALL }
    banner enabled
    banner-text "Multi
Line
Banner"
    description none
    inactivity-timeout 0
    include none
    log-level info
    login enabled
}

To save hit ESC twiced they type :wq
Then type a 'y' to confirm the changes in tmsh
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
Perfect, thank you!
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
I use this command:

tmsh modify sys sshd banner-text '"This
is
a
wrapped
banner"'
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
SMP,

How do you apply that command without the system taking a return at the end of the first line?

thanks,
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
Not sure I understand what you mean. If you don't want the wraps, you put it all on a single line like this:

tmsh modify sys sshd banner-text '"This is a SSH banner"'


Is that what you mean? If you want the wraps, you enter CRLFs where you want them, like in the sample command I initially provided. My sample was from 10.2.x, not sure what may have changed in v11.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
Sorry I was not clear. I was more specifically looking for what a CRLF looked like in TMSH.

tmsh modify sys sshd banner-text '"TEST (crlf)
Banner (crlf)
Multi (crlf)
Line"'

So what would go in place of the "(crlf)"

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
I execute this command from the unix shell, not inside TMSH. Since I'm using single quotes, unix simply accepts the enter key as a CRLF character until I close the command with a final trailing single quote. I don't believe I've ever tried this command from within TMSH. If I get a minute here soon, I'll try it out.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
I did not have much luck within TMSH, but I also find TMSH very difficult to work in. Maybe someone with better skillz will step in and help.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

 

If you are entering the commands from the command line, as opposed to editing the section of the configuration you may need to use two commands.  One to change the text:

 tmsh modify sys sshd banner-text '"multiline text line 1

line 2 "'

and one to enable the banner:

 tmsh modify sys sshd banner enable.

It may also be helpful to point out that the format for the multiline input opened with a single quote, then a double quote, and closed with a double quote then a single quote.

0