ユーザ用ツール

サイト用ツール


ubuntu-server-18-04:sshd

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ubuntu-server-18-04:sshd [2019/08/23 17:27]
admin [ログイン用公開鍵の設置]
ubuntu-server-18-04:sshd [2020/04/09 20:44] (現在)
admin [ログイン用公開鍵の設置]
行 3: 行 3:
 SSHサーバの設定を変更してセキュリティを強化する。 SSHサーバの設定を変更してセキュリティを強化する。
  
-===== 環境 ===== 
  
-  * Ubuntu +===== インストール環境 ===== 
-    * Ubuntu 18.04.3 LTS 64bit + 
-  * openssh-server +  * Ubuntu 18.04.3 LTS 64bit 
-    * 1:7.6p1-4ubuntu0.3 +  * お名前.com VPS (KVM) 1GB プラン 
 + 
 +^ パッケージ名 ^ バージョン ^ 
 +openssh-server 1:7.6p1-4ubuntu0.3 
 + 
  
 ===== インストールと設定 ===== ===== インストールと設定 =====
行 48: 行 52:
  
 <code> <code>
-$ diff ~/backup/etc/ssh/sshd_config.original /etc/ssh/sshd_config  +$ diff ./sshd_config.original ./sshd_config 
-5a6 +13a14 
-> Port 5555 +> Port 37784 
-28c29,30 +32a34
-< PermitRootLogin without-password +
---- +
-> #PermitRootLogin without-password+
 > PermitRootLogin no > PermitRootLogin no
-52a55+56a59
 > PasswordAuthentication no > PasswordAuthentication no
-88a92,99+123c126,131 
 +< PasswordAuthentication yes 
 +--- 
 +> #PasswordAuthentication yes
  
- 
-> # Added by admin begin 
 > AllowUsers foo > AllowUsers foo
- 
-> # Added by admin end 
- 
  
 </code> </code>
行 82: 行 81:
 鍵長が短くても良い場合は "-b 4096" は不要。 鍵長が短くても良い場合は "-b 4096" は不要。
 <code> <code>
-$ ssh-keygen -t rsa -b 4096 -f ./ssh_key+$ ssh-keygen -t rsa -b 4096 -C "Comment of Key" -f ./ssh_key
 </code> </code>
  
行 95: 行 94:
 $ cd ~/ $ cd ~/
 $ mkdir ./.ssh $ mkdir ./.ssh
-$ cat ./id_rsa.pub >> ./.ssh/authorized_keys+$ cat ./id_rsa.pub >> ~/.ssh/authorized_keys
 </code> </code>
  
ubuntu-server-18-04/sshd.1566548829.txt.gz · 最終更新: 2019/08/23 17:27 by admin