Centos修改SSH端口号

Posted by 冰河 at 03:12 2 Responses » 28,639 Views
072012

1.添加端口

vim /etc/ssh/sshd_config

将#Port 22的注释去掉并且换行加入Port 443

如果是不是增加,而是修改端口的话,建议先保留22端口,等新端口可以登录再去掉。

443其实是https使用的端口,3128是squid使用的端口。建议使用大端口,比如10000~65535以上。

重启SSH服务 /etc/init.d/sshd restart
或者
Centos:service sshd restart
Debian:service ssh restart

2.防火墙开启443端口
vi /etc/sysconfig/iptables

加入-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

或者

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
service iptables save

重启防火墙 /etc/init.d/iptables restart

#ClientAliveInterval 60
#ClientAliveCountMax 3

262012

错误代码:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Traceback (most recent call last):
File “/usr/bin/yum”, line 29, in yummain.user_main(sys.argv[1:], exit_code=True)
File “/usr/share/yum-cli/yummain.py”, line 309, in user_main errcode = main(args)
File “/usr/share/yum-cli/yummain.py”, line 178, in main result, resultmsgs = base.doCommands()
File “/usr/share/yum-cli/cli.py”, line 345, in doCommands self._getTs(needTsRemove)
File “/usr/lib/python2.4/site-packages/yum/depsolve.py”, line 101, in _getTsself._getTsInfo(remove_only)
File “/usr/lib/python2.4/site-packages/yum/depsolve.py”, line 112, in _getTsInfopkgSack = self.pkgSack
File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 661, in pkgSack = property(fget=lambda self: self._getSacks(),
File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 501, in _getSacksself.repos.populateSack(which=repos)
File “/usr/lib/python2.4/site-packages/yum/repos.py”, line 232, in populateSackself.doSetup()
File “/usr/lib/python2.4/site-packages/yum/repos.py”, line 79, in doSetupself.ayum.plugins.run(‘postreposetup’)
File “/usr/lib/python2.4/site-packages/yum/plugins.py”, line 179, in runfunc(conduitcls(self, self.base, conf, **kwargs))
File “/usr/lib/yum-plugins/fastestmirror.py”, line 181, in postreposetup_hookall_urls = FastestMirror(all_urls).get_mirrorlist()
File “/usr/lib/yum-plugins/fastestmirror.py”, line 333, in get_mirrorlistself._poll_mirrors()
File “/usr/lib/yum-plugins/fastestmirror.py”, line 376, in _poll_mirrorspollThread.start()
File “/usr/lib/python2.4/threading.py”, line 416, in start_start_new_thread(self.__bootstrap, ())
thread.error: can’t start new thread

Continue reading »

© 2009 - 2024 冰河的博客