You can display a warning message to unauthorized users or display a welcome message or informational message to authorized users for SSH, and telnet logins in HP-UX. These messages can be displayed through banners, a legal banner contains some security warning information or general information, that alerts the user. It can be used for security, legal info, company policy, etc.
There is two way to display messages one is using the /etc/issue file and the second one is using the /etc/motd file.
- /etc/issue: Display a banner message before the password login prompt.
- /etc/motd: Display a banner message after the user has logged in.
Display SSH Warning Message Before Login
You can display the banner message before login through /etc/issue file, this message will be displayed before the password login prompt. Follow the process shown below:
- Open the master ssh configuration file /etc/opt/ssh/sshd_config to enable banners.
# vi /etc/opt/ssh/sshd_config
or
# vi /opt/ssh/etc/sshd_config - Search for the word “Banner”, add the line Banner /etc/issue and save the file.
..
..# no default banner path
# Banner none
Banner /etc/issue..
.. - Now open the file /etc/issue in vi editor and add the message which you want to display, save the file.
# vi /etc/issue ***************************************************************
* Welcome to Test Server *
* All connections are monitored and recorded *
* Disconnect IMMEDIATELY if you are not an authorized user! *
***************************************************************
~
~ - restart the SSH daemon to reflect new changes.
# /sbin/init.d/secsh stop
HP-UX Secure Shell stopped# /sbin/init.d/secsh start
HP-UX Secure Shell started - Now try to connect to the server, you will get the below message:
login as: root
***************************************************************
* Welcome to Test Server *
* All connections are monitored and recorded *
* Disconnect IMMEDIATELY if you are not an authorized user! *
***************************************************************
Using keyboard-interactive authentication.
Password:
Display SSH Warning Message After Login
To display banner messages after login, you need to modify the /etc/motd file, which is used to display banner messages after login.
- Open the file /etc/motd in vi editor.
# vi /etc/motd - Add the banner message and save the file.
***************************************************************
* Welcome to Test Server *
* All connections are monitored and recorded *
* Disconnect IMMEDIATELY if you are not an authorized user! *
***************************************************************
~
~ - Now again try to login into the server you will get both the banner messages.
login as: root
***************************************************************
* Welcome to Test Server *
* All connections are monitored and recorded *
* Disconnect IMMEDIATELY if you are not an authorized user! *
***************************************************************
Using keyboard-interactive authentication.
Password:
Last successful login: Fri Jan 13 12:42:49 IST 2017 174.11.1.11
Last authentication failure: Fri Jan 13 11:11:40 IST 2017 174.11.1.11
Last login: Fri Jan 13 12:42:49 2017 from 174.11.1.11
***************************************************************
* Welcome to Test Server *
* All connections are monitored and recorded *
* Disconnect IMMEDIATELY if you are not an authorized user! *
***************************************************************Value of TERM has been set to “xterm”.
WARNING: YOU ARE SUPERUSER !!# - You will see the banner after login two times, to resolve this issue you need to comment the below lines in /etc/profile file.
# vi /etc/profile //Comments the below lines in the above file
# Message of the day#if [ -r /etc/motd ]
#then
#cat /etc/motd
#fi
Note: The above process was performed on HP-UX 11.31.
Related Posts
- How to Find NIC (Network Interface Card) Details in HP-UX
- How to Install a .depot Package Using swinstall on HP-UX
- HP-UX: How to restrict NFS share access to a particular server?
- crontab: you are not authorized to use cron. Sorry. in HP-UX
- HP-UX: SSH taking too much time after adding the DNS Servers
- How to add DNS servers on an HP-UX server
- How to login to vPar console in HP-UX
- How to extend the size of Logical Volume (LV) in HP-UX
- How to determine file system type in HP-UX using command
- How to check vPar machines status in HP-UX
- How to find HBA cards/ports and WWN Number details in HP-UX (nPar)
- How to find HBA cards/ports and WWN Number details in HP-UX (vPar)
- HP-UX command to get Physical Memory Information
- HP-UX command to get Processor Information
- HP-UX command to get Hardware Serial Number
- su: Sorry in HP-UX while switching from normal user to root user
- SSH login taking too much time on HP-UX 11.31
- How to Disable Root SHH Login in HP-UX?
- hpvmstatus: HPVM currently not running.
- How to view/print routing table in HP-UX?
- Create a Logical Volume larger than 2TB and format it in HP-UX
- Protect SSH Logins with SSH and MOTD Banner Messages in HP-UX
- Remove welcome message after login in HP-UX 11.31
- Create a Logical Volume and format it in HP-UX
- How to rescan new LUNs added in HP-UX 11.31
- How to reboot a HP-UX machine?
- How to remove File System, LV and VG in HP-UX and Linux?
- How to remove NO_HW devices from ioscan in HP-UX without a reboot?
- Change root user password of vpar machine in HP-UX