Removing the SFTP login banner
Overview
SFTP Gateway comes with a login banner for the SFTP protocol.
Note: This is not to be confused with the OpenSSH banner for the SSH protocol.
When connecting via FileZilla, you won't see an SFTP banner. But it shows up when connecting via command line SFTP.
$ sftp robtest@52.250.17.203
The authenticity of host '52.250.17.203 (52.250.17.203)' can't be established.
ECDSA key fingerprint is SHA256:TjMJgP9Pi5OJNTXe/ETLQ7y6SU5pxEWjZ4TbRVjifqw.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '52.250.17.203' (ECDSA) to the list of known hosts.
____ _____ _____ ____ ____ _
/ ___| | ___||_ _|| _ \ / ___| __ _ | |_ ___ __ __ __ _ _ _
\___ \ | |_ | | | |_) | | | _ / _` || __|/ _ \\ \ /\ / // _` || | | |
___) || _| | | | __/ | |_| || (_| || |_| __/ \ V V /| (_| || |_| |
|____/ |_| |_| |_| \____| \__,_| \__|\___| \_/\_/ \__,_| \__, |
|___/
Copyright (c) 2021, Thorn Technologies LLC - https://www.thorntech.com
Version 3.1.0
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information please visit: https://www.thorntech.com/products/sftpgateway
For news and updates follow us on Twitter: @sftpgateway - https://twitter.com/sftpgateway
password
Enter password for robtest
The SFTP banner is bundled into the SFTP Gateway Java Jar file. This article goes over how to override this SFTP banner.
Overriding the banner
SSH into your VM using port 2222
.
Run this command to elevate your privileges:
sudo su
Create a new text file containing your SFTP banner message:
/opt/sftpgw/banner.txt
Edit the following file:
/opt/sftpgw/application.properties
Add the following line:
sftp.banner-path=file:banner.txt
Restart Java to apply your change:
service sftpgw-admin-api restart
When you connect via SFTP, you should see the new banner text:
$ sftp robtest@52.250.17.203
custom banner text testing 123
password