I'm sharing my internet in work and forgot to turn it off! Does anyone know how I can do it via the command line? I have SSH access but thats it. D'oh.
2 Answers
You could use this to turn it off:
sudo ifconfig en1 down
And if you want to get it back up, just type up, instead of down
Just make sure that en1 is the right interface or you can easily kill off your ssh access :)
P.S. As Lri noted in the comments below, you can quickly disable the correct network interface with just 1 line:
sudo ifconfig `networksetup -listallhardwareports | grep -E '(Wi-Fi|AirPort)' -A 1 | grep -o "en."` down
This will detect the correct Airport/wireless device and will turn it off
-
Or
en0
on MacBook Airs. You can find out the device name withnetworksetup -listallhardwareports | grep -E '(Wi-Fi|AirPort)' -A 1 | grep -o "en."
.– LriCommented May 16, 2012 at 14:35