Disable SSL redirection via SSH

Anything regarding SSL/SSH and other security questions may go here
Forum rules
We've moved! Head over to Synology Community (community.synology.com) to meet up with our team and other Synology enthusiasts!
ghostmac
I'm New!
I'm New!
Posts: 2
Joined: Thu Jan 31, 2013 6:55 pm

Disable SSL redirection via SSH

Unread post by ghostmac » Thu Jan 31, 2013 7:07 pm

I was remotely connected to DSM and enabled HTTPS and redirection to 5001.
It was immediately after I clicked apply that I realized my error in that I didn't have 5001 port forwarded :cry:
All HTTP requests to 5000 get redirected to 5001 where then my NAT ignores.

Can anyone pretty please tell me how I can disable Apache's redirect via ssh?
I've already looked at /usr/syno/etc/httpd-* but think that I've missed it.
Anyone been through this before??


I've tried ssh'ing to my ddwrt router but can remember what port I moved ssh to :oops:
Riding the failboat this morning . .

BigTim
I'm New!
I'm New!
Posts: 9
Joined: Sat Jan 15, 2011 8:34 pm

Re: Disable SSL redirection via SSH

Unread post by BigTim » Sun Feb 10, 2013 1:34 am

Is there room aboard for one more? I've just done exactly the same thing...

I had a look at the httpd.conf-sys which seems to be the web server conf file that is in use based on a list of the active apache processes. I could see there is an include that pulls in the SSL related stuff from the conf/extra directory.

Unfortunately I know just about enough to be dangerous rather than be competent enough to fix it manually so not about to start hacking it up.

Unless someone else can help out here, I'm going to have to wait until I get back home to the NAS and router and fix it locally.

On the bright side, at least it's sort of secure....

cejka
Beginner
Beginner
Posts: 26
Joined: Fri Nov 26, 2010 1:26 pm

Re: Disable SSL redirection via SSH

Unread post by cejka » Mon Apr 15, 2013 8:36 pm

ghostmac wrote:I was remotely connected to DSM and enabled HTTPS and redirection to 5001.
It was immediately after I clicked apply that I realized my error in that I didn't have 5001 port forwarded :cry:
All HTTP requests to 5000 get redirected to 5001 where then my NAT ignores.

Can anyone pretty please tell me how I can disable Apache's redirect via ssh?
I've already looked at /usr/syno/etc/httpd-* but think that I've missed it.
Anyone been through this before??


I've tried ssh'ing to my ddwrt router but can remember what port I moved ssh to :oops:
Riding the failboat this morning . .
I have DS-209+II and my Firefox can't open it's DSM via HTTPS. So I just do this and it's work:

1) Log into your DS as root via SSH
2) cd /etc
3) vi synoinfo.conf
4) press "/" and type "runHTTPS" without quotes of course, appropriate settings line will looks like this one: runHTTPS="yes".
5) press "i" key
6) change the runHTTPS="yes" to runHTTPS="no" on settings line
7) press ESC key
8) type ":wq" and press Enter (without quotes)
9) on command line type: /usr/syno/etc/rc.d/S97apache-sys.sh restart
10) open your web browser and try to connect to your DS on its IP address (ex. 192.168.1.15)

Now you should be able to connect to your DSM without HTTPS.

sukchr
I'm New!
I'm New!
Posts: 2
Joined: Wed May 29, 2013 6:29 pm

Re: Disable SSL redirection via SSH

Unread post by sukchr » Wed May 29, 2013 6:31 pm

cejka wrote:
...

I have DS-209+II and my Firefox can't open it's DSM via HTTPS. So I just do this and it's work:

1) Log into your DS as root via SSH
2) cd /etc
3) vi synoinfo.conf
4) press "/" and type "runHTTPS" without quotes of course, appropriate settings line will looks like this one: runHTTPS="yes".
5) press "i" key
6) change the runHTTPS="yes" to runHTTPS="no" on settings line
7) press ESC key
8) type ":wq" and press Enter (without quotes)
9) on command line type: /usr/syno/etc/rc.d/S97apache-sys.sh restart
10) open your web browser and try to connect to your DS on its IP address (ex. 192.168.1.15)

Now you should be able to connect to your DSM without HTTPS.
Excellent step by step explanation! Worked like a charm! Thank you!

J.Aza
Beginner
Beginner
Posts: 27
Joined: Wed Jul 08, 2009 1:08 am

Re: Disable SSL redirection via SSH

Unread post by J.Aza » Fri Jul 04, 2014 10:09 pm

Excellent post! Saved my bacon. Thank you.

metaworx
I'm New!
I'm New!
Posts: 1
Joined: Wed Dec 10, 2014 1:08 pm

Re: Disable SSL redirection via SSH

Unread post by metaworx » Wed Dec 10, 2014 1:24 pm

cejka wrote: 4) press "/" and type "runHTTPS" without quotes of course, appropriate settings line will looks like this one: runHTTPS="yes".
5) press "i" key
6) change the runHTTPS="yes" to runHTTPS="no" on settings line
please note, that the initial request was to diasable redirection only. the key mentioned (runHTTPS) disables HTTPS completely. there is an other key called redirectHTTPS which specificity only stops the redirection feature. so you might want to use

Code: Select all

runHTTPS="yes"
redirectHTTPS="no"
cejka wrote: 9) on command line type: /usr/syno/etc/rc.d/S97apache-sys.sh restart
as of DSM v5 the command given above is depricated. use the following command instead:

Code: Select all

synoservicectl --restart httpd-sys

smike2809
I'm New!
I'm New!
Posts: 3
Joined: Sat Apr 02, 2016 10:34 pm

Re: Disable SSL redirection via SSH

Unread post by smike2809 » Sat Apr 02, 2016 10:40 pm

Hi,
with the new DSM v6 it's not possible to disable the redirection because I don't see it in the list (see image).
How can I disable the redirection ? I have an SSH access but no access to the web interface.
http://zupimages.net/up/16/13/ryyu.png


Thanks
mike

User avatar
lbutlr
Experienced
Experienced
Posts: 137
Joined: Fri Jul 22, 2016 2:24 am
Contact:

Re: Disable SSL redirection via SSH

Unread post by lbutlr » Mon Jul 25, 2016 7:44 pm

smike2809 wrote:Hi,
with the new DSM v6 it's not possible to disable the redirection because I don't see it in the list (see image).
How can I disable the redirection ? I have an SSH access but no access to the web interface.
http://zupimages.net/up/16/13/ryyu.png
DSM6 uses nginx instead of apache, so the commands are different. The edits have to be done in /etc/nginx/nginx.conf Just look for the block that redirects to block 5001 and comment it out.
“The chief obstacle to the progress of the human race is the human race. ”
― Don Marquis

TechB0ss
I'm New!
I'm New!
Posts: 1
Joined: Tue Jul 04, 2017 7:01 pm

Re: Disable SSL redirection via SSH

Unread post by TechB0ss » Tue Jul 04, 2017 7:12 pm

I was able to locate the file smike2809 said to use but after making the appropriate changes, saving the file, and restarting the nginx service, I'm still redirected to 5001. I checked nginx.conf and the file I edited reverted back to the original script. I tried a couple of times, each time verifying the changes exist in nginx.conf before restarting the service. Can someone provide insight as to what is causing the nginx.conf to revert back to it's original state?

mcsonic
I'm New!
I'm New!
Posts: 1
Joined: Sun Jan 28, 2018 1:32 am

Re: Disable SSL redirection via SSH

Unread post by mcsonic » Sun Jan 28, 2018 1:39 am

what helped for me (DS213j, DSM 6) was changing the DSM.json file
1) ssh to synology

2) cd /usr/syno/etc/www
3) sudo cp DSM.json DSM.json.bak

4) changing the entry "redirect" : true
to "redirect" : false in the DSM.json file
(via sudo vi DSM.json)

5) restart nginx
sudo nginx -s reload

hhhh4
I'm New!
I'm New!
Posts: 4
Joined: Fri May 26, 2017 1:29 pm

Re: Disable SSL redirection via SSH

Unread post by hhhh4 » Wed Apr 25, 2018 9:40 am

I can't restart nginx. :( have somebody any idea?
user@diskstation:/usr/syno/etc/www$ sudo nginx -s reload
nginx: [error] invalid PID number "" in "/run/nginx.pid"

Code: Select all

{
    "directAccess" : false,
    "fqdn" : null,
    "https" :
    {
        "compatibility" : 1,
        "compression" : false,
        "hsts" : false
    },
    "max_connections" : null,
    "port" : 5000,
    "server_tag" : "nginx",
    "ssl" :
    {
        "certificate" : "/usr/syno/etc/ssl/ssl.chain.crt/server.crt",
        "key" : "/usr/syno/etc/ssl/ssl.key/server.key",
        "port" : 5001,
        "redirect" : false,
        "spdy" : true
    },
    "version" : 1
}

hhhh4
I'm New!
I'm New!
Posts: 4
Joined: Fri May 26, 2017 1:29 pm

Re: Disable SSL redirection via SSH

Unread post by hhhh4 » Wed Apr 25, 2018 10:06 am

I do a "reboot". It's working with port 80.

Locked

Return to “Security/Secured Mods”