1
0

EC2インスタンスに作業用ユーザーを追加

Posted at

まずはユーザー追加。wheelグループに追加してsudo権限

[prompt] $ su -
[prompt] # useradd username
[prompt] # usermod -G wheel username

パスワード無しでsudo出来るように
visudoを編集

[prompt] # visudo
%wheel  ALL=(ALL)       NOPASSWD: ALL

追加ユーザーのsshキー作成

[prompt] # su - username
[prompt] # ssh-keygen -t rsa

公開鍵を調整

[prompt] # cd .~/.ssh
[prompt] # cat id_rsa.pub >> authorized_keys
[prompt] # chmod 600 authorized_keys

秘密鍵をローカルにダウンロード

[prompt] # cd .~/.ssh
[prompt] less id_rsa

ローカルから秘密鍵「id_rsa」を使用してsshでログインする

1
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
1
0