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.

ネットワーク上の別マシンへの接続(telnet,ssh)

Posted at

この記事の前提

・macOS Catalinaでのターミナル経由での接続。

telnet(ウェルノウンポート:22番)

いま使ってるOSだとtelnetコマンドがインストールされていなかったから、
もし使うならhomebrewなどを利用してローカルマシンへ入れる。

以下で接続可能。

telnet [接続先サーバのホスト名 or IP]

ただ、この方法だと通信内容が暗号化されていないので、通信の中身が丸見えになる。
(サーバによってはtelnetでの接続を禁止しているかも)

だから、sshを利用するといい。

ちなみに、ポート80で接続するとhttp通信もできる。(ウェルノウンポートそのままなら)
https://qiita.com/honeycom/items/d44590dd27d5dccb4b5a

ちゃっちゃとhttp通信のレスポンス見たいならcurlを使うか
ウェブブラウザにURL入れるほうが早いけど、telnetでも一応できる模様。

ssh(ウェルノウンポート:23番)

以下で接続可能。

ssh [接続サーバのホスト名 or IP]

別のマシンへ接続するためのID・パスワードが指定されている場合は、
コマンド内で指定してあげると接続できる。
(パスワードは後で聞かれるので、入力したり鍵ファイルで対応したりする)

ssh [ユーザ名]@[接続サーバのホスト名 or IP]

詳しくはインターネットでsshとぐぐれば出てくるので、そちらを参照する。

参考にしたサイト

https://www.infraexpert.com/study/tcpip19.html
https://www.atmarkit.co.jp/ait/articles/1701/26/news015.html

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?