AWSのEC2でサーバ立ち上げて見たものの ポート22からの接続が社内ネットワークからは許可されていなかったー(´;ω;`) みたいなときにポート22以外で接続できるように設定する方法です。 ■環境: Amazon Linux AMI release 2014.09 ■サンプルのポート: 54321 1.SSHのポート番号を変更 $ sudo vim /etc/ssh/sshd_config # If you want to change the port on a SELinux system, you have to tell # SELinux about this change. # semanage port -a -t ssh_port_t -p tcp #PORTNUMBER # #Port 22 Port 54321 2.sshdを再起動 $ sudo /usr/sbin/
![AWSのEC2にポート22以外でSSH接続できるようにする方法 - omohayui blog](https://cdn-ak-scissors.b.st-hatena.com/image/square/56d903a26bc2343aed8a0e43bf2c09d3aa58a3cc/height=288;version=1;width=512/https%3A%2F%2Fcdn.image.st-hatena.com%2Fimage%2Fscale%2F0e9679b033d60e2d160a55164de40d4ec8624eec%2Fbackend%3Dimagemagick%3Bheight%3D1300%3Bversion%3D1%3Bwidth%3D1300%2Fhttp%253A%252F%252Fblog-imgs-43.fc2.com%252Fo%252Fm%252Fo%252Fomohayui%252FAWS_inbound.png)