2012年11月25日日曜日

sshdの設定


外から色々変えられるようにsshdを立ち上げます。
OS Xの場合は共有設定からenableできますが、念のため公開鍵認証で限定されたアカウントのみでアクセスできるように設定します。

sshd_configの設定の変更
-----
--- sshd_config.org 2012-11-25 19:42:03.000000000 +0900
+++ sshd_config 2012-11-25 19:41:39.000000000 +0900
@@ -41 +41 @@
-#PermitRootLogin yes
+PermitRootLogin no
@@ -47,2 +47,2 @@
-#PubkeyAuthentication yes
-#AuthorizedKeysFile .ssh/authorized_keys
+PubkeyAuthentication yes
+AuthorizedKeysFile .ssh/authorized_keys
@@ -51 +51 @@
-#RhostsRSAAuthentication no
+RhostsRSAAuthentication no
@@ -53 +53 @@
-#HostbasedAuthentication no
+HostbasedAuthentication no
@@ -62,2 +62,2 @@
-#PasswordAuthentication no
-#PermitEmptyPasswords no
+PasswordAuthentication no
+PermitEmptyPasswords no
@@ -71 +71 @@
-#ChallengeResponseAuthentication yes
+ChallengeResponseAuthentication no
@@ -75 +75 @@
-#KerberosOrLocalPasswd yes
+KerberosOrLocalPasswd no
@@ -129,0 +130,3 @@
+
+AllowUsers hogehoge
-----

routerのポートマッピングの設定でport22をmac-miniに転送するように設定します。
これで鍵を登録しているクライアントからのみlogin出来るようになります。

0 件のコメント:

コメントを投稿