LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-03-2014, 03:26 AM   #1
atengesdal
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Rep: Reputation: Disabled
Question Reach ssh server when connected to VPN


Hi,

I have an Ubuntu 12.04 server connected to ISP through ETH interface, and is always activated on OpenVPN (Privateinternetaccess). I would like to reach this server through ssh but can't really understand how to do this step-by-step. First, what needs to be done on the modem that the server (and rest of the network is connected to)? itself? It's a zyxel, assuming this needs to be set up with port forwarding?
Until now I have just used teamviewer to access my server when out of the house :-)
After this, then what? My servers' external IP address has now of course changed due to VPN, so how can I reach it again?

Thanks,

Arve
 
Old 04-04-2014, 12:35 AM   #2
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 509

Rep: Reputation: 203Reputation: 203Reputation: 203
Hi,

Let's look at this without the VPN component first. To SSH into your server, you're on the right track. There are 2 steps, namely:

* Configure the router for forward traffic for port 22 (SSH) to your server. I don't know the ZyXEL routers to advise on how to do this, but it's fairly straight forward on most routers. You might also find details at http://portforward.com/english/route...warding/ZyXEL/.
* To find the IP address so you can connect to it from outside even if it has changed, you can register it with a dynamic DNS service. Most routers can do the DNS updates for you automatically when the IP changes. It looks like ZyXEL can do the same - see http://help.zyxel.com/documents/webh..._WAN_DDNS.html.

If we add the VPN into the equation, the same principals apply, but some things work a little differently as you're effectively moving the end points of the connection. You didn't supply much information on the OpenVPN setup, though. Could you please elaborate on this a little? Some questions:

* Is the VPN connection established by your router or by your server?
* Where is the other end of the VPN connection - a server you manage, a public VPN service, your office, etc?

This will influence how you do the port forwarding or routing, and where/how you run a suitable DDNS service.

Regards,

Clifford
 
Old 04-04-2014, 01:00 AM   #3
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 509

Rep: Reputation: 203Reputation: 203Reputation: 203
Some additional info on Dynamic DNS on Linux: http://www.linuxhomenetworking.com/w..._:_Dynamic_DNS
 
Old 04-04-2014, 04:48 PM   #4
atengesdal
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi Clifford!
Thanks a lot for your response, appreciated!
After your response, I have done the following:
-Found my external IP address, without VPN
-Registered DDNS and activated host on my server
-Port forwarding in my router to my internal IP address on my server
-After this I am now able to ssh into my server using
xxxx@mynewddnsaddress.xxx; this is without VPN activated, so far so good :-)


To answer your questions:
If we add the VPN into the equation, the same principals apply, but some things work a little differently as you're effectively moving the end points of the connection. You didn't supply much information on the OpenVPN setup, though. Could you please elaborate on this a little? Some questions:

* Is the VPN connection established by your router or by your server?
This is done through my server, only
* Where is the other end of the VPN connection - a server you manage, a public VPN service, your office, etc?
www.privateinternetaccess.com; iaw public VPN service
This will influence how you do the port forwarding or routing, and where/how you run a suitable DDNS service.

This is where I can't understand how this is supposed to work, how can I link my ddns to an IP nobody knows?

Thanks,

Arve

Last edited by atengesdal; 04-04-2014 at 04:51 PM.
 
Old 04-04-2014, 05:10 PM   #5
atengesdal
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by atengesdal View Post
Hi Clifford!
Thanks a lot for your response, appreciated!
After your response, I have done the following:
-Found my external IP address, without VPN
-Registered DDNS and activated host on my server
-Port forwarding in my router to my internal IP address on my server
-After this I am now able to ssh into my server using
xxxx@mynewddnsaddress.xxx; this is without VPN activated, so far so good :-)


To answer your questions:
If we add the VPN into the equation, the same principals apply, but some things work a little differently as you're effectively moving the end points of the connection. You didn't supply much information on the OpenVPN setup, though. Could you please elaborate on this a little? Some questions:

* Is the VPN connection established by your router or by your server?
This is done through my server, only
* Where is the other end of the VPN connection - a server you manage, a public VPN service, your office, etc?
www.privateinternetaccess.com; iaw public VPN service
This will influence how you do the port forwarding or routing, and where/how you run a suitable DDNS service.

This is where I can't understand how this is supposed to work, how can I link my ddns to an IP nobody knows?

Thanks,

Arve
Funny thing is, now it seems OK, I can reach my server through DDNS service, but when my server asks me for the password it returns back as illegal. Any idea? Is there a mismatch between my RSD* keystring or whatever it is called :-) and my laptop? It works fine without VPN, but won't accept my ssh when server is connected to VPN..

Thanks,

Arve
 
Old 04-04-2014, 05:21 PM   #6
atengesdal
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by atengesdal View Post
Funny thing is, now it seems OK, I can reach my server through DDNS service, but when my server asks me for the password it returns back as illegal. Any idea? Is there a mismatch between my RSD* keystring or whatever it is called :-) and my laptop? It works fine without VPN, but won't accept my ssh when server is connected to VPN..

Thanks,

Arve
And this is the output:
Apr 4 23:57:20 ENGWINST sshd[13597]: Accepted password for root from 192.168.10
.170 port 34430 ssh2
Apr 4 23:57:20 ENGWINST sshd[13597]: pam_unix(sshd:session): session opened for
user root by (uid=0)
Apr 5 00:00:01 ENGWINST CRON[13803]: pam_unix(cron:session): session opened for
user root by (uid=0)
Apr 5 00:00:01 ENGWINST CRON[13803]: pam_unix(cron:session): session closed for
user root
Apr 5 00:02:26 ENGWINST sshd[13597]: Received disconnect from 192.168.10.170: 1
1: disconnected by user

and the password is correct is correct..

Last edited by atengesdal; 04-04-2014 at 05:24 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PPTP Packets from the VPN Client Cannot Reach the VPN server SubZeroJake Linux - Networking 1 05-14-2012 06:52 PM
Setting up a VPN for windows clients to reach debian server over the public Internet irvken Linux - Networking 1 01-30-2010 05:35 AM
VPN pptpd connected vpn server only access need help please u4david Linux - Networking 1 10-17-2008 03:54 PM
openvpn client couldn't reach other servers behind vpn server jeffhan Linux - Networking 2 08-27-2006 11:20 PM
PoPToP VPN with Shorewall: can only reach PoPToP server pgwillemsen Linux - Networking 0 12-27-2004 07:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration