LoginSignup
6

More than 3 years have passed since last update.

MacアドレスからSSH接続

Last updated at Posted at 2019-09-06

読むと下記が手にはいる

  • RaspberryPiやJetson Nanoで超簡単にSSH接続する方法
  • 毎回IPアドレスを調べずともSSH接続できる(IPの固定化不要)

方法

同じネットワークに接続されている別端末から下記コマンドでログインパスいれるだけ。

arp -an | grep "your-mac-address" | tr -d "()" | awk '{print $2}' | xargs sh -c 'ssh yourusername@"$@" </dev/tty' ssh

IPアドレスだけ知りたい場合は下記。

arp -an | grep "your-mac-address" | tr -d "()" | awk '{print $2}'

Macアドレスを知りたい場合は下記。

ifconfig | grep "ether" | awk '{print $2}' | awk 'END{print}'

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
6