{"id":1031,"date":"2014-04-21T07:43:02","date_gmt":"2014-04-21T07:43:02","guid":{"rendered":"http:\/\/scunster.co.uk\/?p=1031"},"modified":"2014-04-21T07:51:09","modified_gmt":"2014-04-21T07:51:09","slug":"display-ssh-warning-message-before-after-logon","status":"publish","type":"post","link":"https:\/\/scunster.co.uk\/?p=1031","title":{"rendered":"Display SSH warning message before &#038; after logon"},"content":{"rendered":"<p>Log on to your server as su and create the message text you want to show<\/p>\n<pre>vi \/etc\/ssh\/warning.txt<\/pre>\n<p>Now, create your message by pressing &#8220;i&#8221; to enter text insert mode, press &#8220;esc&#8221; when you are done.<\/p>\n<pre>#######################################\r\n#                                     #\r\n#     Warning - Private SSH Server    #\r\n#       Please leave immediately      #\r\n#                                     #\r\n#######################################<\/pre>\n<p>Press :w to save and :q to quit vi<\/p>\n<p>Edit the main ssh config file and let it know that you are using a banner<\/p>\n<pre># vi \/etc\/ssh\/sshd_config<\/pre>\n<p>Search for the word banner and change the line from<\/p>\n<pre>#Banner \/some\/path<\/pre>\n<p>to<\/p>\n<pre>Banner \/etc\/ssh\/warning.txt<\/pre>\n<p>Now restart ssh<\/p>\n<pre># \/etc\/init.d\/sshd restart<\/pre>\n<p>Login to your server and see the new message<\/p>\n<p>You can do exactly the same to display a message <strong>after<\/strong> the user logs in by editing the file \/etc\/motd<\/p>\n<pre>vi \/etc\/motd<\/pre>\n<p>This file is read by CentOS every time a user starts a shell session so no restart or ssh config is required.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Log on to your server as su and create the message text you want to show vi \/etc\/ssh\/warning.txt Now, create your message by pressing &#8220;i&#8221; to enter text insert mode, press &#8220;esc&#8221; when you are done. ####################################### # # # Warning &#8211; Private SSH Server # # Please leave immediately # # # ####################################### Press [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[164,3,171,12],"tags":[],"class_list":["post-1031","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-security-linux","category-webhosting"],"_links":{"self":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1031"}],"version-history":[{"count":3,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1031\/revisions"}],"predecessor-version":[{"id":1034,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1031\/revisions\/1034"}],"wp:attachment":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}