SSHPORT from /etc/amportal.conf

FreePBX CentOS release 5.8 (Final)
Installation manual from .tar.gz

There is problem on non-standard SSH port, php function ctype_digit need to get argument string not int. More info on php manual.
I change it by adding on line 376 in /var/www/html/admin/modules/dashboard/page.index.php in ctype_digit argument (string)$amp_conf[‘SSHPORT’].

All line before:
$ssh_port = (isset($amp_conf[‘SSHPORT’]) &&
ctype_digit($amp_conf[‘SSHPORT’]) &&
($amp_conf[‘SSHPORT’] > 0) && ($amp_conf[‘SSHPORT’] < 65536))?

And after:
$ssh_port = (isset($amp_conf[‘SSHPORT’]) &&
ctype_digit((string)$amp_conf[‘SSHPORT’]) &&
($amp_conf[‘SSHPORT’] > 0) && ($amp_conf[‘SSHPORT’] < 65536))?

If you look to the right of your page can you click on the Report Bug/Feature link and report this with a patch. Developers very rarely take bugs in the forums and do anything with it.

I’d love to see this automated since I always use non-standard ssh so I always have to go in and make the manual change in advanced settings.

Let me get this straight, you want to write code that scrapes the SSH configuration (out of what OS? FreePBX theoretically runs on any *nix POSIX platform) and determines the port?

All this so you don’t have to change 1 value?

If you do it this often you would know that you can change the variable from the command line using amportal and add this to your startup script.

but it’s easy. Isn’t that your reply to everything? “Just use a putty tunnel, it’s easy”. “Just use a Juniper router, it’s easy”.

Please do me a favor and stop polluting my posts with your annoying bs.

If you feel it’s important than write it and submit the code. Would love to have you on the developers role.

I am entitled to my 2 cents. I know what works and what doesn’t. There are so many true workload reducing features on the road map you have to make choices.

I might not have to keep explaining to people how to use tunnels if we the team gets some more OpenVPN integration done. Possibly you have noticed now three major phone vendors support OpenVPN in the endpoint. Not sure why you brought it up but it’s an important development. You can spout all you want but a properly configured VPN is the most reliable way to enable remote SIP users.

I think we can just preg_match the /etc/ssh/sshd_config file in most system and then default to 22 if not present

Perhaps thinking outside the box, perhaps be proactive and suggest/push the change into sshd.conf at the same time, there are probably many who don’t know how to change the port in sshd and why it is even desirable, but very few who don’t understand that amportal needs that change done at the same time.

Might also be a good time to tie it back into the backup module and make key generation a little more automated and less confusing for some. I guess it needs a hook into a more priviliged user than the webserver though . . .


FreePBX runs as a non root user. This is impossible without doing amportal hooks.

That’s what I said I thought, mostly amportal will be run as root though, no?

I am not a developer but some mechanism has to exist to access system files, how else can you change the ip from sysadmin pro?

Because you have to write specialized scripts/functions for sysadmin to work. I can’t go into details without breaking NDA. However with that talk the ssh port might be better suited for sysadmin.

That variable is modified in advanced settings. It is imperative that you do not change variables externally to FreePBX. These are not valid instructions and are dangerous.