{"id":203104,"date":"2020-10-16T08:47:37","date_gmt":"2020-10-16T00:47:37","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=203104"},"modified":"2020-10-15T15:48:24","modified_gmt":"2020-10-15T07:48:24","slug":"ssh-banner-msg","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/ssh-banner-msg.html","title":{"rendered":"Linux\u7cfb\u7edf\u4f7f\u7528SSH\u767b\u5f55\u4e4b\u524d\u5982\u4f55\u663e\u793a\u6a2a\u5e45\u6d88\u606f"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5e0c\u671b\u5728OpenSSH (SSHD\u670d\u52a1\u5668)\u8eab\u4efd\u9a8c\u8bc1\u4e4b\u524d\u663e\u793a\u6d88\u606f\u6216\u6a2a\u5e45?\u5c1d\u8bd5\u4f7f\u7528\u8fd9\u4e2a\u7b80\u5355\u7684\u6280\u5de7\u5728\u4f60\u7684Linux\u7cfb\u7edf\u4e0a\u663e\u793aBanner\u6216ASCII\u827a\u672f\u5b57\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

OpenSSH\u6709\u4e00\u4e2a\u540d\u4e3aBanner\u7684\u5185\u7f6e\u9009\u9879\u3002\u5728\u5141\u8bb8\u8eab\u4efd\u9a8c\u8bc1\u4e4b\u524d\uff0c\u5c06\u6307\u5b9a\u6587\u4ef6\u7684\u5185\u5bb9\u53d1\u9001\u7ed9\u8fdc\u7a0b\u7528\u6237\u3002\u5982\u679cBanner\u9009\u9879\u8bbe\u7f6e\u4e3anone\uff0c\u90a3\u4e48\u5728ssh\u767b\u5f55\u65f6\u5c31\u4e0d\u4f1a\u663e\u793a\u4efb\u4f55Banner\u6d88\u606f\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4e0d\u663e\u793a\u6a2a\u5e45\uff0c\u5e76\u4e14\u7981\u7528\u8be5\u9009\u9879\u3002<\/p>\n

\u7cfb\u7edf\u73af\u5883<\/strong><\/div>\n

Centos7<\/p>\n

\u5982\u4f55\u5f00\u542fbanner\u9009\u9879<\/strong><\/div>\n

1\u3001\u767b\u5f55\u5230\u8fdc\u7a0b\u7684Linux\u64cd\u4f5c\u7cfb\u7edf\u3002<\/p>\n

2\u3001\u7f16\u8f91\/etc\/ssh\/sshd_config<\/code>\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

\r\n[root@localhost ~]# vim \/etc\/ssh\/sshd_config \r\n<\/pre>\n

3\u3001\u5728\u914d\u7f6e\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0Banner \/etc\/ssh\/my_banner<\/code>\u8fd9\u4e00\u884c\u5185\u5bb9\uff1a<\/p>\n

\r\nBanner \/etc\/ssh\/my_banner\r\n<\/pre>\n

\"\"
\n4\u3001\u4fdd\u5b58\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u9000\u51fa\u7f16\u8f91\u3002<\/p>\n

5\u3001\u521b\u5efa\/etc\/ssh\/my_banner<\/code>\u6587\u4ef6\uff1a<\/p>\n

\r\n[root@localhost ~]# touch \/etc\/ssh\/my_banner\r\n<\/pre>\n

6\u3001\u91cd\u542fsshd\u670d\u52a1\uff1a<\/p>\n

\r\n[root@localhost ~]# systemctl restart sshd\r\n<\/pre>\n
\u627e\u4e00\u4e2a\u81ea\u5df1\u559c\u6b22\u7684ASCII Art\u56fe\u6848<\/strong><\/div>\n

\u53ef\u4ee5\u7f51\u4e0a\u641c\u7d22ASCII art\uff0c\u4f1a\u6709\u8bb8\u591a\u751f\u6210ascii \u827a\u672f\u5b57\u7684\u7f51\u7ad9\u3002\u8fd8\u53ef\u4ee5\u5c06\u56fe\u7247\u8f6c\u6362\u6210ASCII\u7c7b\u578b\u7684\u3002<\/p>\n

\u53e6\u4e00\u79cd\u65b9\u5f0f\u662f\u4f7f\u7528figlet<\/code>\u547d\u4ee4\u751f\u6210\u666e\u901a\u5b57\u7b26\u7684\u653e\u5927\u7248\u3002\u5728centos\u4e2d\u9700\u8981\u5b89\u88c5epel\u6e90\uff0c\u7136\u540e\u5b89\u88c5figlet\u7a0b\u5e8f\uff1a<\/p>\n

\r\n[root@localhost ~]# yum -y install figlet\r\n[root@localhost ~]# figlet LinuxProbe\r\n<\/pre>\n

\"\"
\n\u53ef\u4ee5\u770b\u5230\u751f\u6210\u7684\u6587\u5b57\u3002\u6211\u4eec\u53ef\u4ee5\u5c06figlet\u751f\u6210\u7684\u827a\u672f\u5b57\u4f53\u5199\u5165\/etc\/ssh\/my_banner<\/code>\u6587\u4ef6\u4e2d\uff1a<\/p>\n

\r\n[root@localhost ~]# figlet LinuxProbe > \/etc\/ssh\/my_banner \r\n<\/pre>\n

\u73b0\u5728\u53ef\u4ee5ssh\u767b\u5f55\u8fd9\u53f0linux\u64cd\u4f5c\u7cfb\u7edf\u770b\u4e00\u4e0b\uff1a<\/p>\n

\r\n[root@localhost ~]# ssh root@localhost\r\n<\/pre>\n

\"\"<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u8fd9\u662f\u4e00\u4e2a\u65b9\u4fbf\u7684\u5c0f\u7279\u6027\uff0c\u53ef\u4ee5\u4e30\u5bcc\u4f60\u7684\u7ec8\u7aef\u4f53\u9a8c\uff0cASCII\u827a\u672f\u5b57\u4e5f\u53ef\u4ee5\u5728\/etc\/motd\u914d\u7f6e\u6587\u4ef6\u4e2d\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

OpenSSH\u6709\u4e00\u4e2a\u540d\u4e3aBanner\u7684\u5185\u7f6e\u9009\u9879\u3002\u5728\u5141\u8bb8\u8eab\u4efd\u9a8c\u8bc1\u4e4b\u524d\uff0c\u5c06\u6307\u5b9a\u6587\u4ef6\u7684\u5185\u5bb9\u53d1\u9001\u7ed9\u8fdc\u7a0b\u7528\u6237\u3002\u5982\u679cBan […]<\/p>\n","protected":false},"author":309,"featured_media":203105,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-203104","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/203104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=203104"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/203104\/revisions"}],"predecessor-version":[{"id":203109,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/203104\/revisions\/203109"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/203105"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=203104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=203104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=203104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}