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 3 years have passed since last update.

SSHの転送先を制限する方法(authorized_keys版)

Last updated at Posted at 2020-10-21

authorized_keys を編集

  • 以下のように行の先頭にオプションを記載
command="/bin/false",no-agent-forwarding,no-pty,no-user-rc,no-X11-forwarding,permitopen="example.com:22" ssh-rsa AAA-.......
  • よく利用するオプション
    • permitopen="host:port"
      転送を許可されたホスト:ポート
      複数の転送先を記述するときは以下のように並べる
    permitopen="hostA:port",permitopen="hostB:port",... 
    
    • from="pattern-list"
      ssh接続を許可するホストリスト
    • no-agent-forwarding
      認証エージェント転送禁止
    • no-port-forwarding
      ポートフォワーディング禁止
    • no-pty
      仮想端末の割り当て禁止
    • command="command"
      実行可能なコマンド
    • environment="NAME=value"
      環境変数
    • no-user-rc
      ~/.ssh/rcの実行禁止
    • no-X11-forwarding
      X11転送禁止
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?