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?

MacでSSH接続する

Last updated at Posted at 2024-09-14

MacでSSH接続を行う方法を説明します。

以下の手順に従ってください。

  1. ターミナルを開く:

    • Finderで「アプリケーション」 > 「ユーティリティ」 > 「ターミナル」を選択します。
  2. SSHキーの生成:

    • 新しいSSHキーを生成するには、以下のコマンドを実行します。
      ssh-keygen -t ed25519 -C "your_email@example.com"
      
      • your_email@example.com の部分は自分のメールアドレスに置き換えてください。
  3. 公開鍵をサーバーに追加:

    • 生成された公開鍵(~/.ssh/id_ed25519.pub)を接続先のサーバーに追加します。通常、サーバーの ~/.ssh/authorized_keys ファイルに追加します。
  4. SSH接続の設定:

    • ~/.ssh/config ファイルを作成または編集し、以下のように設定します。
      Host 接続名
        HostName ホスト名
        User ユーザー名
        IdentityFile ~/.ssh/id_ed25519
        Port ポート番号
      
      • 接続名, ホスト名, ユーザー名, ポート番号 を適宜置き換えてください。
  5. 接続の確認:

    • 設定が完了したら、以下のコマンドで接続を確認します。
      ssh 接続名
      

これで、MacからSSH接続ができるようになるはずです.

ソース:
(1) SSH接続のやり方をめちゃくちゃ詳しく解説する for Mac - Qiita. https://qiita.com/rihib/items/9b1f611619695cbf68a0.
(2) MacのTerminalで「 ssh 接続名」で SSH 接続 - Qiita. https://qiita.com/blendthink/items/d31e5c19751644129efc.
(3) Macにsshで接続してログインしよう!sshでの接続方法解説 .... https://aprico-media.com/posts/1319.
(4) Macのターミナルでssh接続 - Qiita. https://qiita.com/Yui-00/items/8bc9be260db8ec668f65.

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?