System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to make Welcome message in linux - RHEL

SOLVED
Go to solution
WW288996
Frequent Advisor

How to make Welcome message in linux - RHEL

Hi,

I want to put some welcome message in linux.

For example if some one access my machine using ssh it should display first welcome message and then it should give Login prompt.

I know /etc/motd but it gives only after they login to the system.

Please help if some one know how to do this.
4 REPLIES
Matti_Kurkela
Honored Contributor

Re: How to make Welcome message in linux - RHEL

When SSH is used, the server system will never send a login prompt to be displayed to the client user. The username for login is transmitted non-interactively inside the SSH protocol metadata.

If no username is configured, PuTTY will display a "login as:" prompt - but it happens *before* the SSH network connection is initiated. The connection is made only *after* the user specifies the username.

What you can do is make the sshd send a message just before authentication, whether it is by prompting for a password or by SSH keys. The instructions are in the sshd documentation: please see "man sshd_config".

Create a text file that contains your message, for example /etc/my-ssh-message.txt.
Then add to /etc/ssh/sshd_config file a line like this:

Banner /etc/my-ssh-message.txt

Restart sshd and you're done.

MK
MK
WW288996
Frequent Advisor

Re: How to make Welcome message in linux - RHEL

I have done this but unfortunatly its not working.
Kranti Mahmud
Honored Contributor

Re: How to make Welcome message in linux - RHEL

Hi WW288996

It is very simple, just need to have write access to the file located in the /etc folder and the complete path to the file is this:

/etc/motd

and here you can set whatever you want, and save it, and the next time you login via text-mode you will see that the message has changed to whatever you putted on the file.

Else check the link:

http://www.foogazi.com/2008/04/10/quickzi-how-to-add-a-welcome-message-for-ssh-users/

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
GUNASEKARAN_1
Occasional Advisor
Solution

Re: How to make Welcome message in linux - RHEL

Hi,

Try using this!



Step 1:

Create a banner file that contains text you want people to see when connecting to your SSH server.

Create and open the banner file:

# vi /home/adam/banner

Add your text:

This is the banner file for test.com! Welcome!

Write the file and quit:

:wq

Step 2:

Edit sshd_config to set a default banner path.

# vi /etc/ssh/sshd_config

then add the following to the config file:

Banner /path/to/banner

Write the file and quit:

:wq

Step 3:

Restart the sshd server.

# /etc/init.d/sshd restart

Step 4:

SSH to your server and test to see if the banner is working:

# ssh adam@foogazi.com
This is the banner file for test.com! Welcome!

adam@test.com's password:
#