Jump to content
Not connected, Your IP: 3.129.249.105
Terry Stanford

Running VPN on VPS - How the hell do you connect once VPN running?!!

Recommended Posts

On 2/6/2021 at 10:22 PM, NaDre said:

See here:

https://github.com/tool-maker/VPN_just_for_torrents/wiki/Maintaining-SSH-Access-Using-a-VPN-on-a-Remote-Linux-Server

The scripts there are the ones I currently use.

If you use AirVPN's client, be sure you turn off "network lock".

 

Hi Nadre, sorry to bother you but I have a question about your github script linked above.
I wanted to try it. I can now access my server by logging in via native IP after a reboot, then connect Eddie to VPN server, then login again. It's a messy workaround and I would really like the solution you gave to work, so I can always access it via it's native IP whether the VPS is connected to the VPN or not.

I just ran your full instructions exactly as written, but it doesn't work for me. I connected to Eddie and my ssh connection dropped out. I could then get in to the VPN server IP so my ssh connections still can only reach the VPS via the VPN exit IP. Do you have any ideas why it might fail? Unless the server needs rebooting after running through your instructions?
Thanks
 

Share this post


Link to post
14 minutes ago, Terry Stanford said:
Hi Nadre, sorry to bother you but I have a question about your github script linked above.
I wanted to try it. I can now access my server by logging in via native IP after a reboot, then connect Eddie to VPN server, then login again. It's a messy workaround and I would really like the solution you gave to work, so I can always access it via it's native IP whether the VPS is connected to the VPN or not.

I just ran your full instructions exactly as written, but it doesn't work for me. I connected to Eddie and my ssh connection dropped out. I could then get in to the VPN server IP so my ssh connections still can only reach the VPS via the VPN exit IP. Do you have any ideas why it might fail? Unless the server needs rebooting after running through your instructions?
Thanks
 

Did you disable "network lock"?

I use the native OpenVPN client rather than one of AirVPN's wrapper programs. But if you can stop AirVPN's client from blocking all traffic on the real interface, then it should work.

EDIT:

Why not try it using just the "openvpn" executable that comes with your OS? Just generate one configuration file to try this. If that works, then you know the issue is with the wrapper program.

One thing may be if you do not have "sudo" set up to elevate without a password. My scripts assume this. Ubuntu did this by default the last time I used it. For Debian some additional set up is needed. Are you being prompted for passwords? Do you see any messages that suggest sudo has been disallowed?

If sudo requires a password, than I suggest running the script like this:
 
sudo $HOME/bin/native_if_return_on
You could then remove "sudo " in the commands in the script if you want. My scripts are just meant as examples.
 

Share this post


Link to post

Hi, thanks for the reply Nadre.
Yep Network Locked is not activated, I don't/wont use that at all.
I see. I hoped by moving from Mullvad to AirVPN (with Eddie being based on ovpn) these commands and workarounds would work for me! So there are differences between Eddie and Ovpn standard client which prevent it working?

12 minutes ago, NaDre said:

But if you can stop AirVPN's client from blocking all traffic on the real interface, then it should work.

That's pretty much exactly my problem, thats the problem I have had for two weeks now, not knowing how to do these things, I can just basically paste commands and usually understand what they are doing, but writing it for myself or working out how to, that's for 2022 ;):D
I will see if I can find some old threads I had in my browser which may have had commands for it. Thanks again

Share this post


Link to post
3 minutes ago, Terry Stanford said:

Hi, thanks for the reply Nadre.
Yep Network Locked is not activated, I don't/wont use that at all.
I see. I hoped by moving from Mullvad to AirVPN (with Eddie being based on ovpn) these commands and workarounds would work for me! So there are differences between Eddie and Ovpn standard client which prevent it working?

That's pretty much exactly my problem, thats the problem I have had for two weeks now, not knowing how to do these things, I can just basically paste commands and usually understand what they are doing, but writing it for myself or working out how to, that's for 2022 ;):D
I will see if I can find some old threads I had in my browser which may have had commands for it. Thanks again

I added some additional comments to my post, but you replied before I finished. So here they are again ...

Why not try it using just the "openvpn" executable that comes with your OS? Just generate one configuration file to try this. If that works, then you know the issue is with the wrapper program. I am unlikely to install an AirVPN client just so that I can help you trouble-shoot this.

One thing may be if you do not have "sudo" set up to elevate without a password. My scripts assume this. Ubuntu did this by default the last time I used it. For Debian some additional set up is needed. Are you being prompted for passwords? Do you see any messages that suggest sudo has been disallowed?

If sudo requires a password, than I suggest running the script like this:
 
sudo $HOME/bin/native_if_return_on
You could then remove "sudo " in the commands in the script if you want. My scripts are just meant as examples.
 

Share this post


Link to post

Thanks. "My scripts are just meant as examples." - not sure what you mean here, I take it they work for some people as your page seems very popular!!

I am running Ubuntu 20.04. I don't know if OpenVPN comes preinstalled with my VPS provider's Ubuntu installer (nothing else did!!) But I could install it yes, although it starts to get messy and I am currently connecting nicely with Eddie GUI and I would quite like to keep that if possible as I am comfortable with it. I did read some pages on installing and managing openvpn and it wasn't easy for me to understand. Hence I hoped Eddie (being based on openvpn) would work the same and thus your scripts would work.

I did add my user to sudo group, I can do root level commands with it, but yes it asks for a password the first time I use "sudo" in each session. I don't really know if you're suggesting I should run that sudo $HOME... command in my CLI?

The VPS company have one help page on this exact topic (how to connect over ssh after VPN connection established from VPS), here is their guidance. I tried this before when running mullvad app, I have not tried these commands since installing Eddie. Do you think these commands are worth a try?

Screenshot-2021-02-10-at-15-12-15.png

(I know the port number will need changing to my ssh port which is not 22, but other than that it looks like those commands be run as they are?)

Share this post


Link to post

Referring back to the command in a previous post : eddie-ui --cli --connect --netlock

I tried this but it failed saying "Run the program with login & password of your AirVPN account."
It suggests using :

 

eddie-cli -login=mynick -password=mypassword

 


I note it says eddie-cli, not eddie-ui --cli. I am confused.
Could someone please drop me the full command to use to both connect with netlock as well as provide login credentials.
I Tried guessing but they all failed. thanks

Share this post


Link to post
2 hours ago, Terry Stanford said:

PS - I did try running the command you put at the end of your post. I got this error:

sudo: /home/username/bin/native_if_return_on : command not found


Did you put the script in "~/bin"? The script source is NOT intended to just be copied and pasted into a command window! Create a script called "native_if_return_on" in the "bin" sub-folder in your home folder. Create the "bin" folder first if does not already exist. Also ensure that the "executable" file attribute for  "native_if_return_on" is on.

The commands in my guide show how to do this using an SSH window. But you can create ~/bin/native_if_return_on" any way you are comfortable with. If you have a GUI, the file manager in your GUI should let you create the "bin" folder and set the file attributes for the script file. You can use the GUI editor from your GUI too.

Once that is done you run the script by entering "native_if_return_on" into a command window.

If you do not know what a "Linux file attribute" is, maybe try using Google?
 

Share this post


Link to post

Hey, dude, if you don't want to bother, don't bother. But asking "maybe try using Google?" is insulting, and clearly so as I have said many times I have spent over a week researching the internet.
Also, maybe you should try reading my posts. I have told you I ran through your github instructions completely, thus you know I have the "bin" folder as your instructions created that, and the two files, and the contents I pasted in using nano, etc etc, short version, as I said, I did what your guide said.

And yeah, I do know what a file attribute is, thanks. If you can't spare the time or just can't stand explaining to beginners, that's totally fine, just say that. I am not dumb enough to not know I can look things up on Google, hence you went for insults where you could have just saved all your time and not responded at all, and the outcome would have been better.

Share this post


Link to post
On 2/10/2021 at 6:43 PM, Terry Stanford said:

eddie-cli -login=mynick -password=mypassword


Yeah, no, this is a remnant of the old separation between eddie-ui and eddie-cli in Eddie versions before 2.18.9, I think. The latter is now called with eddie-ui --cli. I agree that it's confusing and should be changed accordingly.
But yes, --login username --password password is probably also needed if there is no default.profile file in ~/.config/Eddie/. Simply append them to the command I gave you and change username and password to your own.
 

NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image

×
×
  • Create New...