SSH: displays custom warning information when FTP is sent to a remote server.

Source: Internet
Author: User

When we SSH and FTP are sent to our remote server, we want to remind the login user to display our custom warning information locally and prompt the user.

SSH

Method 1: The method is found on the Internet,

Enable the SSH service by default.
[[Email protected] ~] # Grep "printmotd"/etc/ssh/sshd_config
Printmotd Yes

 

Edit the prompt file/etc/motd, Which is empty by default.
[[Email protected] ~] # Vim/etc/motd
Warning you have logged on to an important server and all operations will be recorded.
Illegal operations will be held legally responsible !!
Proceed with caution!

Client logon Test
[[Email protected] ~] # SSH 10.1.1.25
[Email protected]'s password:
Last login: Thu Nov 22 10:21:16 2012 from station25.cluster.com
Warning you have logged on to an important server and all operations will be recorded.
Illegal operations will be held legally responsible !!
Proceed with caution!

Method 2: This method is set on our server.

[[Email protected] ~] # Touch/etc/sshbanner
[[Email protected] ~] # Chown bin: Bin/etc/sshbanner
[[Email protected] ~] # Chmod 644/etc/sshbanner
[[Email protected] ~] # Echo "authorized users only. All activity may be monitored and reported">/etc/sshbanner

Modify the configuration file and add the blue font section at the bottom of the file.

[[Email protected] ~] VI/etc/ssh/sshd_config
Banner/etc/sshbanner

Then restart the service. I ran it for a while. The first method was displayed after the user successfully logged on, and the second method was displayed before the user logged on. you can experiment with it to see the effect.



FTP

Method 1

Add information

VI/etc/vsftpd. conf

Ftpd_banner = "authorized users only. All activity may be monitored and reported ."

Method 2:

[[Email protected] ~] # Touch/etc/ftpbanner
[[Email protected] ~] # Chown bin: Bin/etc/ftpbanner
[[Email protected] ~] # Chmod 644/etc/ftpbanner
[[Email protected] ~] # Echo "authorized users only. All activity may be monitored and reported">/etc/ftpbanner


[[Email protected] ~] VI/etc/vsftpd. conf

Banner_file =/etc/ftpbanner

When a user logs on, the/etc/ftpbanner file is displayed.


There is a small difference between the two methods. In man's process, the following information is found in the banner_file process:

"This option is the name of a file containing text to display when someone connects to the server. If set, it overrides the banner string provided by the ftpd_banner option"


That is to say, after you set banner_file, the content displayed in ftpd_banner will be overwritten.



Wait for the experts to add.


This article from the "Linux cainiao" blog, please be sure to keep this source http://ludihua.blog.51cto.com/4601284/1565890

SSH: displays custom warning information when FTP is sent to a remote server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.