Autostart Surfshark on login

I’m using Surfshark ,is it possible to start Surfshark automatically when I start my PC?

Hello kiekeboe,

I use XFCE and have there in the “Settings” -> “Session and startup behavior” - there is certainly also for Gnome. There in the tab “Automatically started applications” I can create / place their own entries.
Is that what you are looking for?

I use KDE plasma?

Let’s try a web search:

https://swisscows.com/web?query=kde%20autostart%20application

and that leads to:

https://userbase.kde.org/System_Settings/Autostart

Wow, that was quick! :grinning_face_with_smiling_eyes:

1 Like

or a search from System Settings :man_shrugging:

That would imply the user knows that System Settings exists. :wink:

1 Like

Let me tell first that I’m a beginner.And I know System Settings :wink: My problem is that have to start Surfshark in a terminal…first I must give my password,then I must chose the server and then I’ve to chose between TCP or UDP, so my question is how can I do that?

Oh, wait, this is a paid-for VPN service. That means they have their own customer support:

https://support.surfshark.com/hc/en-us

It’s likely you can set up a VPN profile using Network Manager, for example:

https://wiki.archlinux.org/index.php/Networkmanager-openvpn

I had contact with customer support of Surfshark,they have only a method for Debian based distro’s.

Reading https://aur.archlinux.org/packages/surfshark-vpn it appears this VPN uses OpenVPN so you can configure it using Network Manager (via the networkmanager-openvpn plugin).

Ask customer support for the relevant OpenVPN settings.

If they don’t support Arch-based distributions then you might want to find a provider that does.

This is what they send me:

1. Create auth.txt file inside /etc/openvpn directory via this command:

sudo gedit /etc/openvpn/auth.txt
 
Fill it with your SurfShark Service Credentials:

username

password

Save it.

2. Then open the file which you are using to establish a connection:

sudo gedit /etc/openvpn/ca-mon.prod.surfshark.com_udp.ovpn

And change this line:

auth-user-pass

into

auth-user-pass auth.txt

Save the file and change its name:

sudo mv /etc/openvpn/ca-mon.prod.surfshark.com_udp.ovpn /etc/openvpn/ca-mon.conf

3. Then you will have to edit the startup on boot file via this command:

sudo gedit /etc/default/openvpn

When the text editor opens, add this line above #AUTOSTART=“all”:

AUTOSTART=“ca-mon”

Save the file and reboot your Linux device.

4. After the reboot - open the terminal and type in:

sudo traceroute 8.8.8.8

The first hop address should be 10.8.8.1 and in ipleak.net you should see Canada Montreal servers IP address.
1 Like

Welcome aboard!
As long as you are using EndeavourOS replacing the word gedit with nano should work here.

I replaced gedit with nano, everything runs fine until point 3, if it opens openvnp, it’s empty, I entered 'AUTOSTART = “ca-mon” ,saved it and then when I execute point 4 (sudo traceroute 8.8.8.8) I get error “sudo: traceroute: command not found”

Install traceroute:


sudo pacman -Syu traceroute
1 Like

Error is gone,but no connection with Surfshark ?

Does ip a show a tunnel?
something like :

3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 500
    link/none 
    inet **.***.***.*/24 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 ****::****::****::****::****/64scope link stable-privacy

Is your user member of group openvpn/nm-openvpn?
(Maybe the developer uses a different group entry, due to being proprietary as far as I understand)

[willy@willy-precisionworkstationt3500 ~]$ sudo traceroute 8.8.8.8
[sudo] wachtwoord voor willy: 
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
 1  _gateway (192.168.0.1)  8.290 ms  8.260 ms  8.244 ms
 2  * * *
 3  * * *
 4  * * *
 5  dD5E0FA6D.access.telenet.be (213.224.250.109)  28.767 ms  33.466 ms  32.289 ms
 6  dD5E07D03.access.telenet.be (213.224.125.3)  34.569 ms  30.714 ms  31.810 ms
 7  108.170.241.225 (108.170.241.225)  31.793 ms 108.170.241.161 (108.170.241.161)  14.779 ms 108.170.241.193 (108.170.241.193)  20.056 ms
 8  108.170.236.139 (108.170.236.139)  18.895 ms 108.170.227.3 (108.170.227.3)  24.307 ms 108.170.236.141 (108.170.236.141)  17.888 ms
 9  dns.google (8.8.8.8)  22.448 ms  21.797 ms  20.371 ms
[willy@willy-precisionworkstationt3500 ~]$ sudo surfshark-vpn status
Not connected to Surfshark VPN

that is what I recive after ‘sudo traceroute 8.8.8.8’