Linux ssh服务器配置
配置文件在/etc/sshd_config,注意只有root可rw,其他所有用户权限为---。
配置说明可参考man sshd_config。
如果更改了服务器端口号,并且启用了SELinux,需要执行以下命令:
semanage port -a -t ssh_port_t -p tcp YOUR_TCP_PORT
# 使用以下命令查看更改效果
# semanage port -l | grep "ssh"
# ssh_port_t tcp YOUR_NEW_PORT, 22
# 该更改复位后保持有效。
# 如需删除,将-a替换为-d即可:
# semanage port -d -t ssh_port_t -p tcp YOUR_TCP_PORT
# 使用semanage port -d -t ssh_port_t -p tcp 22无法删除port 22,
# 大意是说port 22由policy定义。待查。
建议更改默认端口。
另外几个建议更改的配置:
# The time after which the server disconnects if the user has not successfully logged in.
LoginGraceTime 30s
# Specifies the maximum number of authentication attempts permitted per connection.
# Once the number of failures reaches half this value, additional failures are logged.
MaxAuthTries 4
# 限制root远程登录
PermitRootLogin no
最新文章
- Java多线程之构造与发布
- Google 开源技术protobuf
- php中explode与split的区别介绍
- JQuery实现对勾事件代码
- [翻译]:SQL死锁-死锁排除
- js 中escape,encodeURI,encodeURIComponent的区别
- IOS-TextField控件详解
- Rainyday.js – 傻眼了!竟然有如此逼真的雨滴效果
- C#全角转换成半角并检查
- hibernate对象关系实现(三)多对多实现
- C# 自定义重绘TabControl
- scp命令使用
- ODAC with Oracle Developer Tools for Visual Studio
- Apple-Watch开发
- 问题解决: WordPress on SAE注册邮件无法发送
- The table name must be enclosed in double quotation marks or sqare bracket while accessing EXCEL by
- H5中用js让页面全屏
- Axure安装、破解、汉化全套
- 关于deepin linux15.6-15.9.1系统播放视频卡顿解决办法
- fiddler2抓包数据工具使用教程
热门文章
- 极大极小搜索思想+(α/β)减枝 【转自-----https://blog.csdn.net/hzk_cpp/article/details/79275772】
- Codeforces 1005D:Polycarp and Div 3
- 在学习linux基础入门时的一些问题总结(1)
- debian 安装使用NTP
- Js判断字符的种类
- 【JVM】jvm虚拟机参数解析
- Mybatis二(高级部分)
- 在公司上wifi
- taro 最佳实践
- TypeScript 之 声明文件的使用