服务器远程root屏蔽以及登录端口设定(ssh)
来源:互联网 发布:世界经济统计数据库 编辑:程序博客网 时间:2024/05/24 02:37
为了安全考虑,有时候我们希望远程登录服务器时,防止使用超级用户(root)直接进行登录并且修改ssh默认登录端口。
修改配置文件: /etc/ssh/sshd_config
修改内容如下所示:
[root@backgw conf]# cat /etc/ssh/sshd_config #$OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $# This is the sshd server system-wide configuration file. See# sshd_config(5) for more information.# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin# The strategy used for options in the default sshd_config shipped with# OpenSSH is to specify options with their default value where# possible, but leave them commented. Uncommented options change a# default value.<span style="color:#ff0000;"><strong>#Port 22Port 60000 ### 修改默认端口号</strong></span>#Protocol 2,1Protocol 2#AddressFamily any#ListenAddress 0.0.0.0#ListenAddress ::# HostKey for protocol version 1#HostKey /etc/ssh/ssh_host_key# HostKeys for protocol version 2#HostKey /etc/ssh/ssh_host_rsa_key#HostKey /etc/ssh/ssh_host_dsa_key# Lifetime and size of ephemeral version 1 server key#KeyRegenerationInterval 1h#ServerKeyBits 768# Logging# obsoletes QuietMode and FascistLogging#SyslogFacility AUTHSyslogFacility AUTHPRIV#LogLevel INFO# Authentication:#LoginGraceTime 2m<strong><span style="color:#ff0000;">PermitRootLogin no # 禁止使用root用户登录系统</span></strong>#StrictModes yes…………………………………………
修改该文件后,重新启动sshd服务
service sshd restart
这样远程登录时,屏蔽root用户以及使用ssh端口为60000(设定默认值)。
这样就可以使用 ssh -p 6000 user@xx.xxx.xx.xxx 来登录服务器。(可以使用telnet xxx.xx.xxx.xxx.xxx 6000 来测试是否可以连接)
0 0
- 服务器远程root屏蔽以及登录端口设定(ssh)
- ssh远程到远程服务器(非22端口号及非root登录)
- ssh远程到远程服务器(非22端口号及非root登录)
- 修改ssh默认端口号以及禁止root账号远程登录
- Linux下修改ssh端口和禁止root远程登录
- Linux下修改ssh端口和禁止root远程登录
- Linux下修改ssh端口和禁止root远程登录
- Linux下修改ssh端口和禁止root远程登录
- linux中禁止root用户ssh远程登录并修改ssh远程登录端口
- ssh远程登录服务器
- SSH远程登录服务器
- SSH远程登录服务器
- ssh-远程登录centos7070端口
- Linux修改SSH端口号和禁止客户端远程root登录
- centos6.5 ssh安全优化,修改默认端口名,禁止root远程登录
- 修改ssh端口和如何禁止root用户的远程登录
- 通过ssh登录远程服务器
- ssh证书远程登录服务器
- Android ActionBar完全解析(下)
- google ProtoBuf开发者指南(比xml和jason都好的协议)
- Cocos2d-x开发---字幕效果
- FFmpeg编解码详细过程
- poj 3155 Hard Life(最大密度子图)
- 服务器远程root屏蔽以及登录端口设定(ssh)
- 广东省知名P2P平台资料
- JDK与JRE的区别与联系
- JS鼠标悬浮切换图片示例
- UINavigationController 返回按钮修改
- 几个距离概念及其应用举例
- 传指针和传指针引用的区别(指针和引用的区别)
- XML Schema小知识
- Java 类路径ClassPath