Forums

Howto access WP by SSH tunnel? (4 posts)

  1. Itzme
    Member
    Posted 2 years ago #

    The server sits behind a firewall and provides a local blog restricted to the LAN.
    I login by SSH and tunnel port 80 of the server to my remote pc.
    This doesn't work with WordPress since WP includes the LAN-IP into it's pages. Obviously this works for the LAN-PCs.

    phpMyAdmin and Tikiwiki can be reached by SSH tunnel which ends in localhost:80 on my box.

    Is there a way to access WP by LAN-IP as well as localhost?

  2. ClaytonJames
    Member
    Posted 2 years ago #

    I login by SSH and tunnel port 80 of the server to my remote pc.

    Not sure I follow you on that. I don't see a need to tunnel anywhere if your traffic is all LAN. ( or even if it is not). SSH server allows direct connections on port 22. Lets assume you use windows clients to access a "Nix server via ssh over your LAN only. Putty, WinSCP and even xming ( if you need x-window forwarding for any reason ), are excellent tools depending on your needs. No tunneling required. Place exceptions in your servers firewall configuration for just the clients you will be using to connect via ssh, edit ssh config to deny remote root logon, and have at it. I access my wordpress server via ssh on my LAN every day using all the tools mentioned above, connecting with just the internal IP address. I access wordpress, phpMyAdmin, and my web apps with a browser using http and https. I'm not sure why you would want to tunnel to reach applications that run on ports 80/443 (phpMyAdmin, TikiWiki, wordpress). I think SSH is for secure shell access or secure file transfer. Are you confusing SSH with SSL?

    Is there a way to access WP by LAN-IP as well as localhost?

    To access from the LAN, your wordpress urls must contain the internal network address of the server. (ie.. http://10.x.x.x/wordpress). If you still must access wordpress from the localhost ( the server it's installed on ) placing an entry in the hosts file that resolves it (127.0.0.1) to 10.x.x.x. should allow you to do that as well.

  3. Itzme
    Member
    Posted 2 years ago #

    I am not within the LAN.
    The blog-clients sit all in the LAN. The only outsider is me.
    I just get SSH access to the server. Well, I'm root, see?

    For everything else I can pull the port through a tunnel and that's it.

    I guess if WP would use relative paths instead of fixed URLs the problem was solved.

    Or it could detect the way a client called it.
    phpMyAdmin does it like that. The links within the Login are relative to the called page's location.
    Later it uses "http://localhost/...." via my tunnel and "http://192.168.../...." when a LAN client uses it.
    ==> no problem with phpMyAdmin

  4. ClaytonJames
    Member
    Posted 2 years ago #

    Ahh... Now, I see. I was a little confused by all the "LAN" and internal IP address references. I made the assumption it was all intranet access only.

    Later it uses "http://localhost/...." via my tunnel

    Your connection must resolve to an RDP or VNC session (to allow you to work as if you are sitting at the server)? Or does pulling port 80 through the ssh tunnel allow the access via "//localhost" ?

    I just get SSH access to the server. Well, I'm root, see?

    Yes, of course. Just a side note... while I am sure that you are already on top of it, I caution against allowing the root account, ssh access. A normal account using su privileges might be safer in the long run. It all sounds a little too deep for me, I guess. Sorry I wasn't any help.

    Best of luck to you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags