![]() |
Re: Enable/Disable ssh server depending on wifi connection
Ok, here's what I've done so far:
Code:
sudo gainrootedit /etc/event.d/sshd I used "vi" to do that. Comment out the first line: Code:
#start on stopped rcSNext step, give a password to "user" Code:
sudo gainrootAdded the lines Code:
AllowUsers userCode:
PermitRootLogin noI have to leave home now, but I think two simple scripts in /etc/network/if-up.d and /etc/network/if-down.d should do the job: start_ssh in /etc/network/if-up.d: Code:
#!bin/shCode:
#!bin/shNoob Question: If you have a device "A" connected to a public wifi (coffee shop, friends house), is there any way to ssh from device "B" into "A" without having to set modem port forwarding? E.g.: if "A" is configured to listen to port 1234 and we know "A"'s public ip, will this work without configuring the modem(assuming 1234 is open)? Code:
ssh -p 1234 user@publicIP |
Re: Enable/Disable ssh server depending on wifi connection
For some reason it does not seem to work. Here's the start script:
Code:
#!/bin/shand then Code:
chmod 755 start_script.shCode:
mkdir /home/user/testAny ideas? |
Re: Enable/Disable ssh server depending on wifi connection
NAILED IT!
On the above script, I replaced Code:
#!/bin/shCode:
#!/bin/ashDon't know what made the difference, I was just experimenting.... :D |
| All times are GMT. The time now is 11:43. |
vBulletin® Version 3.8.8