curlでtelnetを使う【Mac】

今や、WindowsでもMacでもtelnetは初期状態ではインストールされてない。

Windowsでは割と簡単に有効化できるが、Macでtelnetをインストールするのは少し大変そうだった。

ネットで調べてみると、curlでtelnetを使えることがわかったので試してみた。

curl telnet://192.168.xxx.xxx:23

このコマンドでtelnet接続できる。

Windowsでは?

ちなみにWindowsのPowerShellではうまくいかない。

PS C:\Users\user> curl telnet://192.168.xxx.xxx:23
curl : URI プレフィックスが認識されません。
発生場所 行:1 文字:1
+ curl telnet://192.168.xxx.xxx:23
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [Invoke-WebRequest], NotSupportedException
    + FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

WSLではうまくいきました。