ポート設定でコケた

sshのポート変更しようかな...って思い

躓いたところのメモ

 

 設定をいじります

#vim /etc/ssh/sshd_config

#vim /etc/sysconfig/iptables

 

楽勝だ~

#service sshd restart
Stopping sshd: [OK]
Starting sshd: [OK]

#service iptables restart
iptables: Setting chains to policy ACCEPT: filter [OK]
iptables: Flushing firewall rules: [OK]
iptables: Unloading modules: [OK]
iptables: Applying firewall rules: iptables-restore: line 14 failed


!!!!!???

 

iptablesでいじったのは,ここだけ↓

 

*filter
~~~(略)~~~
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT #ここ

 

無駄なスペースが入力されているわけでもなく,スペルミスしているわけでもない.

ふと思いついて,こんな感じに変更

 

*filter
~~~(略)~~~
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT #ここ
COMMIT


COMMITの前に入れるとでけた


調べてみると
設定ファイルを直接編集する際は、
行頭に「*(アスタリスク)」を付けて、最後は「COMMIT」で指定.
その間に書かれた設定がfilterテーブルのルールとなるらしいです.

 

~~参考~~

http://oxynotes.com/?p=6361
http://easyramble.com/change-ssh-port-number.html