为啥要更改ssh端口,一个词”安全”.
各位合租的同志们注意了,现在咱们的服务器ssh端口已经更改为10***,请更改下端口吧^_^
方法如下:
# 编辑 /etc/ssh/ssh_config vi /etc/ssh/ssh_config Port 22 Port 10*** # 编辑 /etc/ssh/sshd_config vi /etc/ssh/sshd_config #加入新的 Port 值 Port 22 Port 10*** # 保存后,重启 SSH 服务: service sshd restart
为啥用两个端口呢?主要是为了防止修改出错导致SSH 再也登不上!更改SSH 客户端的连接端口,测试一下连接,如果新端口能连接成功,则再编辑上面两个文件,删除 Port 22 的配置。如果连接失败,而用 Port 22 连接后再重新配置。
让你们这些扫描程序整天在那儿扫,回家扫扫去.

ssh_config
sshd_config
为啥有两个文件? 默认ssh到底用的哪个呢?
[Reply]
久酷
Reply:
February 6th, 2010 at 15:53
@Timothy, “/etc/ssh/sshd_config”是OpenSSH的配置文件,允许设置选项改变这个daemon的运行。
“/etc/ssh/ssh_config” 文件是OpenSSH系统范围的配置文件,允许你通过设置不同的选项来改变客户端程序的运行方式。
[Reply]
Timothy
Reply:
February 6th, 2010 at 16:27
@久酷, 高深……
[Reply]
该端口,指定用户登录什么的…基本上也就都这些了
[Reply]
你比较谨慎,那接下来就是防范DDos攻击了。
我看书上有写加个缓冲机制,同一时段访问次数超过连接重置。
[Reply]
久酷
Reply:
January 28th, 2010 at 17:51
@LAONB, 我这里加了一个ddos脚本 , 一定程度上防止 ddos
[Reply]
不懂Linux,不会啦!
[Reply]
感谢提醒,已经改动了。
[Reply]
我的貌似没有
[Reply]
想得还真周到~
[Reply]
这个改了,哈哈
[Reply]
端口改了是好事,一般不用默认端口
[Reply]
# 编辑 /etc/ssh/ssh_config
这一行无需更改,这是SSH客户端默认连接端口,也就是设置之后无需使用 -p 10315 来连接其他的电脑,只是这是Server,设置似乎没有什么意义.
[Reply]
咱们的服务器ssh端口已经更改为10315
汗,你这样和没改有区别吗?……囧
[Reply]
久酷
Reply:
January 26th, 2010 at 18:08
@Showfom, 当然有区别,哈哈 ,你不明白的
[Reply]
我不仅改了端口,还禁止了密码登陆,就用私匙 哈哈
[Reply]
@ELL: ELL就待在我家啦………..不要走啦 这里是你家
[Reply]
貌似不用加22端口,重启sshd不会中断当前连接。
[Reply]
@蓝冰: 出去找一个吧,注意找个干净点的,哈
[Reply]
蓝冰
Reply:
January 25th, 2010 at 23:43
@久酷,
无语 ing,ELL不让我出去~!
[Reply]
久酷
Reply:
January 25th, 2010 at 23:44
@蓝冰, 没事,她在我家呢,今晚不回去了.
[Reply]
蓝冰
Reply:
January 25th, 2010 at 23:45
@久酷, 睁着眼说瞎话~!在我家画图呢。
ELL
Reply:
January 26th, 2010 at 01:34
@蓝冰, 你們一個 全部進 烤箱去 哼哼
[Reply]
蓝冰
Reply:
January 26th, 2010 at 09:57
@ELL, 你这么狠心啊
@蓝冰: 挤你个JJ
[Reply]
蓝冰
Reply:
January 25th, 2010 at 23:24
@久酷, 戳
[Reply]
久酷
Reply:
January 25th, 2010 at 23:24
@蓝冰, 戳的是 BB
[Reply]
蓝冰
Reply:
January 25th, 2010 at 23:40
@久酷, 汗,大半夜的!~哪有MM
傻瓜
你这发文频率也太恐怖了
[Reply]
A.shun
Reply:
January 25th, 2010 at 23:07
@A.shun, 打错了。。。沙发达成傻瓜了。。。
结果沙发也没抢到。。囧啊。。吐血啊
[Reply]
久酷
Reply:
January 25th, 2010 at 23:10
@A.shun, 哈哈…..想起来就一直博起,就像…….一样.一次爽到底
[Reply]
蓝冰
Reply:
January 25th, 2010 at 23:21
@久酷, 挤挤
沙发!
[Reply]
久酷
Reply:
January 25th, 2010 at 23:06
@zwwooooo, 大叔改端口
[Reply]
derek
Reply:
January 25th, 2010 at 23:08
@久酷, 马上改。。。。有黑客拿扫描器扫么?
[Reply]
久酷
Reply:
January 25th, 2010 at 23:11
@derek, 有程序一直在扫……..
zwwooooo
Reply:
January 25th, 2010 at 23:11
@久酷, 收到,还是注意安全好
[Reply]