0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SSHのセットアップ

Posted at

SSHのセットアップ

Open SSH Server のインストール

  1. サーバーアプリのインストール
    sudo apt -y update
    sudo apt -y install openssh-server
    
  2. 構成ファイルの設定
    /etc/ssh/sshd_config
    PermitRootLogin no          # root でのログインの抑止
    PermitEmptyPasswords no     # 空のパスワードの抑止
    MaxAuthTries <Nums>         # 最大試行回数
    Port <Nums>                 # ポート番号
    PasswordAuthentication no   # パスワード認証によるログインを禁止
    

公開カギ認証の設定

公開鍵/秘密鍵の生成

  1. ディレクトリの移動
    mkdir ~/.ssh
    chmod 700 ~./ssh
    cd ~/.ssh
    
  2. 生成
    ssh-keygen -t ecdsa -f <file_name>
    
    画面に従いパスフレーズを登録する.
    • オプション
      -t 暗号化手法 (rsa,ecdsa,...)
  3. サーバーに公開鍵を登録
    cd ~/.ssh
    cat <file_name>.pub >> authorized_keys
    chmod 600 authorized_keys
    

SSHの起動

sudo systemctl ssh restart

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?