How to escape a line feed in login banner via CLI?

Reply
Highlighted
Not applicable

How to escape a line feed in login banner via CLI?

What is the escape character/ sequence for LF or CR/LF in cli mode?

Via web interface it is possible to create a multiline login banner with line breaks that looks like the example below.

line 1 test

line 2 login

line 3 banner

This shows up tidy during login via cli and webinterface

$ ssh -l admin 192.168.1.1

line 1 test

line 2 login

line 3 banner

Password:

When configure the set config-output-format show the following code

admin@PA-500# show deviceconfig system

set deviceconfig system login-banner "line 1 test

line 2 login

line 3 banner

"

However, using this code will result into one line only

"line 1 test" and errors Unknown command: line for the remaining lines.


Accepted Solutions
Highlighted
Not applicable

Hello Todd,

Unfortunately this issue was never resolved. The only way to implement a 'clean' multiline login banner that shows up with the intended formatting on CLI and GUI login is to create it via web interface.

Thanks

View solution in original post


All Replies
Highlighted
L3 Networker

admin@PA-4050# set deviceconfig system login-banner "test <br> test3 <br> test56 <br>"

Highlighted
Not applicable

I am afraid that solves it only for the login via web interface.

Via CLI it results into the following banner:

$ ssh -l admin 192.168.1.1

test<br>test3<br>test56<br>Password:

Thanks

Highlighted
L3 Networker

That is because the you are using html so this will only affect the web ui. The ssh session will show you the entire string. If you also want to have this appear via ssh. please login to the web ui --> device --> setup --> configure login banner.

Highlighted
Not applicable

Thank you for the fast answer.

If I want the line breaks to show correctly during CLI login, I have to use the Web UI to configure the login banner?

There is no way to set the same configuration via CLI?

Highlighted
L3 Networker

I need check with engineering.

Highlighted
L0 Member

Good morning. Has there been any update on this? I currently have a 10 line login banner I am attempting to script and I have the same result; it all appears on one line.

The following, as entered, errors after the first line (obviously):

set deviceconfig system login-banner "COMPANY networks and systems are assets of the

corporation and are to be used by authorized personnel for

business purposes only.  COMPANY routinely monitors these

systems to protect them from unauthorized use and to

ensure system integrity.  COMPANY is committed to full

compliance with all data privacy laws and requires the same

of its employees.  Individuals suspected of abusing their

access rights are subject to having their activities monitored

and content reviewed."

Removing the "returns" or new line presents this ALL in one line :

"COMPANY networks and systems are assets of the corporation and are to be used by authorized personnel for business purposes only.  COMPANY routinely

monitors these systems to protect them from unauthorized use and to ensure system integrity.  COMPANY is committed to full compliance with all data privacy laws and requires the same of its employees.  Individuals suspected of abusing their access rights are subject to having their activities monitored and content reviewed."

Highlighted
Not applicable

Hello Todd,

Unfortunately this issue was never resolved. The only way to implement a 'clean' multiline login banner that shows up with the intended formatting on CLI and GUI login is to create it via web interface.

Thanks

View solution in original post

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!