I have a VPS, which one can use noVNC to login. I would like to restrict login through ssh only.
- Can I remove the portion where it is showing the login prompt? (Preferred to mod this, instead of using systemd to mask tty)
hostname login:
I have a VPS, which one can use noVNC to login. I would like to restrict login through ssh only.
hostname login:
If I understand the post you are only asking to change the login prompt over SSH.
sshd
sshd has its own option "?PrintMotd" in /etc/ssh/sshd_config. This defaults to "yes", but is set to "no" in Debian's default configuration since you get the motd twice otherwise: Once printed by pam_motd, the second time by sshd itself. Please note that the motd doesn't show on multiplexed ssh connections, only on the "first" session that also does the authentication. [1]: https://wiki.debian.org/motd#A.2Fetc.2Fmotd_in_current_versions_.288.2B-.29_of_Debian
Or
/etc/issue
The text displayed before the login prompt is stored in /etc/issue (there's a related file, /etc/issue.net, that's displayed before the user logs in, before their shell is started). It's just a normal text file, but it accepts TTY escape sequences:
The issue file can contain certain character sequences to display various information. All issue sequences consist of a backslash () immediately followed by one of the letters explained below (so \d in /etc/issue would insert the current date).
\b -- Baudrate of the current line.
\d -- Current date.
\s -- System name, the name of the operating system.
\l -- Name of the current tty line.
\m -- Architecture identifier of the machine, eg. i486
\n -- Nodename of the machine, also known as the hostname.
\o -- Domainname of the machine.
\r -- Release number of the OS, eg. 1.1.9.
\t -- Current time.
\u -- Number of current users logged in.
\U -- The string "1 user" or " users" where is the number of current users logged in.
\v -- Version of the OS, eg. the build-date etc.