Last active
January 27, 2018 02:40
-
-
Save atpons/424069a45e54eeea9abd6e939779186a to your computer and use it in GitHub Desktop.
Raspberry Pi の IP アドレス固定化 + ssh 自動接続
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: ./autoconfig.sh IP_ADDRESS DEFAULT_GATEWAY | |
echo "[*] fix ip addr" | |
sudo cat <<EOF >> /etc/dhcpcd.conf | |
interface eth0 | |
static ip_address=$1 | |
static routers=$2 | |
static domain_name_servers=$2 | |
EOF | |
echo "[*] enable ssh" | |
sudo systemctl enable ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment