问题原文
原帖链接 · Chen Levy · CC BY-SA 3.0
On a *nix system, when configuring ssh to listen on non standard port,
should I also edit /etc/services to reflect that.
I would think it should be done, so tools that use it (such as ufw) will recognize the correct port for ssh, but I see very little mention of it in documentation and tutorials.
So is it considered good or bad practise to edit /etc/services, and if not, why?
已采纳解答
原帖链接 · Håkan Lindqvist · CC BY-SA 3.0
I don't think it makes sense to edit /etc/services in such a case. The world will not change ssh ports with you, and all programs that look up service names to port numbers on your machine would get the incorrect port for ssh.
If anything, it might make more sense to add an entry of your own for your non-standard ssh port, eg myssh <yourport>/tcp if you want a service name that you can use.
Then there's obviously the age-long debate of whether changing ports like that to "hide" services actually serves any real purpose beyond reducing log spam.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
