0
1

More than 3 years have passed since last update.

macから対象サーバへ鍵なしでログイン出来るようにする

Posted at

macからローカルの鍵を指定し、接続することが煩わしく感じた時の為の備忘録として記します。

前提

使用するOS:mac
接続したいサーバ:AWS上のLinux

手順

①ログインユーザーをつくる

# useradd test

②ユーザーのログインパスワードを設定する

# passwd test
  New Password : hoge

③sshd_config設定を変更する

# sudo vi /etc/ssh/sshd_config 

###以下の行を修正する###
PubkeyAuthentication yes
PasswordAuthentication yes

④sudo権限を追加

# sudovi

###以下行を追加###
test   ALL=(ALL)  ALL

⑤sshdを再起動する

# systemctl restart sshd

⑥ログイン確認をする

# ssh test@IPaddress

後日談

・上記の方法で設定してしまうと、他ユーザでログインする時も絶対パスワードの入力を求められるので、
 他ユーザのパスワード設定もしておいた方がいいです。。。設定していなくてログイン出来なくなりました。

参考サイト

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