个人工具
119.28.94.63
该IP地址的讨论
登录
查看“OpenSSH高级教程”的源代码 - Ubuntu中文
页面
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“OpenSSH高级教程”的源代码
来自Ubuntu中文
←
OpenSSH高级教程
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
=== 验证 === <code><nowiki>LoginGraceTime 120</nowiki></code> 默认设置下,通过sshd登录Ubuntu后,必须在出现操作提示符的120秒(2分钟)内登录系统,不然sshd将会自动切断与主机的连接。这个时间值可以通过LoginGraceTime进行设置 <br> <code><nowiki>LoginGraceTime 20</nowiki></code> 将LoginGraceTime设置为20秒。可以有效的防御自动化阻遏(thwarting automated),暴力攻击ssh,和拒绝服务式攻击(DDOS)。 <br> '<code><nowiki>X11Forwarding yes</nowiki></code> <br>如果你不希望有人能够通过ssh使用图形用户界面的程序(这些程序通过SSH通道-SSH tunnel显示),你可以通过X11Forwarding指令将其关闭,由此来减少很多攻击的可能。<br> <code><nowiki>X11Forwarding no</nowiki></code> <br> 现在,sshd的X11 forwarding功能被关闭了。 <br> https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=IconWarning3.png '''警告''': 我们并不推荐关闭X11 forwarding,如果某个服务是基于使用X11或LTSP的,将X11 Forwarding关闭将导致此服务不可用。 <br> '<code><nowiki>#Banner /etc/issue.net</nowiki></code> <br> 显示一个不欢迎的警示条,或更好的方法对于安全是件好事。它将告知好奇的人,或者未经许可的恶意登录到你的OpenSSH服务器的人,远程访问你的计算机是必须经过许可,并且需要用户授权。 <br> 有一个的不欢迎警示条目可以帮你成功起诉攻击者,或别的组织未经许可的尝试经由ssh访问你的服务器。 <br> '<code><nowiki>Banner /etc/issue.net</nowiki></code> <br> 现在,/etc/ssh/sshd_config中的警示条已经被激活。您可以使用下列的流程创建警句条的实际实际内容。在这里我们给出了一个例子: 使用sudo启动你喜欢的文本编辑软件,创建文件/etc/issue,并把下面的文字拷入此文件作为警示条的内容: <pre>*************************************************************************** NOTICE TO USERS This computer system is the private property of its owner, whether individual, corporate or government. It is for authorized use only. Users (authorized or unauthorized) have no explicit or implicit expectation of privacy. Any or all uses of this system and all files on this system may be intercepted, monitored, recorded, copied, audited, inspected, and disclosed to your employer, to authorized site, government, and law enforcement personnel, as well as authorized officials of government agencies, both domestic and foreign. By using this system, the user consents to such interception, monitoring, recording, copying, auditing, inspection, and disclosure at the discretion of such personnel or officials. Unauthorized or improper use of this system may result in civil and criminal penalties and administrative or disciplinary action, as appropriate. By continuing to use this system you indicate your awareness of and consent to these terms and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the conditions stated in this warning. **************************************************************************** </pre> <code><nowiki>保存文件,并且使用下列命令创建一个到 /etc/issue.net的符号连结:</nowiki></code> <code><nowiki>sudo ln -s /etc/issue /etc/issue.net</nowiki></code> <code><nowiki></nowiki></code> 重新启动sshd后,任何用户想要登陆时都会在登陆提示符前看到上面的信息。所有的非授权访问者将受到一个明确的消息"你的电脑只能通过授权才能使用,不欢迎非授权用户使用。上面例子中的警告条是根据美国国防部(US DEPARTMENT OF DEFENCE)的警告条的修改而成的,完全适合专业用户使用,而且更适合个人用户。 另外,当您作了此设定时,本地控制台的登录会同样显示来自/etc/issue文件的信息,也就是说坐到您电脑前使用你电脑的人也会收到同样的警告信息。如果你不想这样,请删除由符号链接生成的issue.net文件,然后新建一个/etc/issue.net文件并将警示信息写入到这个文件中,并且将/etc/issue清空。/etc/issue没有警示信息,警告将只显示给那些远程访问系统的人。
返回至
OpenSSH高级教程
。