Created
November 19, 2012 20:37
-
-
Save GeorgeErickson/4113720 to your computer and use it in GitHub Desktop.
iCloud ssh config generator
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
#!/usr/bin/env bash | |
# | |
#Shitty script to create a ssh config entry for icloud | |
HOSTNAME=$(echo show Setup:/Network/BackToMyMac | scutil | egrep "[0-9]{1,}.members.btmm.icloud.com" -o) | |
COMPUTER_NAME=$(scutil --get ComputerName) | |
RED=$(tput setaf 9) | |
RESET=$(tput sgr0) | |
echo "${RED}Add the following to your .ssh/config (you probably also have to mess with your sharing preferences): | |
$RESET | |
Host $COMPUTER_NAME | |
User $USER | |
HostName $COMPUTER_NAME.$HOSTNAME | |
AddressFamily inet6 | |
Protocol 2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment