What's new

Enable \ Disable WAN SSH using a script

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

oversim

Regular Contributor
Hello,
I would like to enable or disable ssh daemon wan access.

I tried to automated it using a script

Code:
nvram set sshd_wan=0 (or 1)
service restart_httpd

But it doesn't work.. What is wrong?
 
As you can see from source code, sshd_wan is used only in startfirewall() function. Find what services calls it.

IMHO, it's better to try another approach. You can enable SSH WAN access and add/remove appropriate iptables rule:
Code:
-A INPUT -i ppp0 -p tcp -m tcp --dport XXXXX -m state --state NEW -j SSHBFP
You need to do it twice:
1) in automation script,
2) in /jffs/scripts/firewall-start script, or you custom settings will be lost with next firewall rules update.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top