Source Code Custom Message SSH Before Login Prompt in Linux

emailx45

Social Engineer
Joined
May 5, 2008
Messages
2,387
Reaction score
2,149
Custom Message SSH Before Login Prompt in Linux
Ivan Revelli - 15/May/2020
[SHOWTOGROUPS=4,20]

View attachment 1587



Tested on Ubuntu 18.04 Server.

The file /etc/issue.net is a text file which contains a message or system identification to be printed before the login prompt of a telnet session. It may contain various ‘%-char’ (or, alternatively, ‘\-char’) sequences.

The common char for output some informations are:

1
2
3
4
5
6
7
8
9
10
11
12
13
b Insert the baudrate of the current line.
d Insert the current date.
s Insert the system name, the name of the operating system.
l Insert the name of the current tty line.
m Insert the architecture identifier of the machine, e.g., i686.
n Insert the nodename of the machine, also known as the hostname.
o Insert the domainname of the machine.
r Insert the release number of the kernel, e.g., 2.6.11.12.
t Insert the current time.
u Insert the number of current users logged in.
U Insert the string "1 user" or "<n> users" where <n> is the
number of current users logged in.
v Insert the version of the OS, e.g., the build-date etc.

If you want to display your IP Configuration you can simply add the following line to the issue file:

1My IP address: \4{eth0}


[/SHOWTOGROUPS]
 

ma123rina

New member
Joined
Aug 26, 2012
Messages
1
Reaction score
0
"Hey OP, I think I found a solution for you. You can modify the '/etc/issue' file to add your custom message before the login prompt. That should do the trick, give it a shot!"
 

t0p

New member
Joined
Dec 7, 2010
Messages
1
Reaction score
0
"Hey guys, I've found a solution for this in Ubuntu using PAM. You can modify the `/etc/pam.d/common-session` file to add a custom message. Been using this for ages and it works like a charm."
 

abeceda142

New member
Joined
Jul 20, 2010
Messages
1
Reaction score
0
"Hey OP, check out this thread for a solution: https://askubuntu.com/questions/984444/show-custom-message-before-login-prompt-in-ssh. It should give you some ideas on how to customize your SSH login prompt. Works on Ubuntu-based distros, might need some tweaking for other distros."
 
Top