How clone VPN settings?

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
AndrzejB
Level 1
Level 1
Posts: 19
Joined: Sun Sep 10, 2017 10:42 am

How clone VPN settings?

Post by AndrzejB » Sun Jul 14, 2019 11:36 am

I have VPN connection. I want reinstall Mint. In which files is stored info about VPN?

User avatar
phd21
Level 19
Level 19
Posts: 9169
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: How clone VPN settings?

Post by phd21 » Sun Jul 14, 2019 1:07 pm

Hi AndrzejB,

It would help to know more about your system setup. If you run "inxi -Fxzd" and "lsusb" from the console terminal prompt, highlight the results, copy and paste them back here, that should provide enough information.

It is really fairly easy to import VPN provider's openVPN configuration file(s) "somewhere.ovpn" into your Network Manager to create a new VPN server connection although you still have to edit the VPN connection for login information username and password and maybe specify certificate or a key file.

Install all of these with this one console terminal command and restart your computer before adding (importing) new VPN connections.

Code: Select all

sudo apt install openresolv easy-rsa network-manager-openvpn bind9 unbound 
If you copy over your VPN provider's configuration files, then you might also be able to copy the current system's hidden VPN configuration folder which in my case is located in the folder below.
~/.local/share/networkmanagement/

and copy this root folder, I think the VPN login information like username and passwords are stored here.
/etc/NetworkManager/system-connections/

to your new freshly installed system and restart the computer to restore your Network Manager's connections including VPN connections.

security - Where does GNOME Network Manager store passwords? - Unix & Linux Stack Exchange
https://unix.stackexchange.com/question ... -passwords

Hope this helps ...
Phd21: Mint KDE 18.3 & 19, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram,256gb SDD, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

AndrzejB
Level 1
Level 1
Posts: 19
Joined: Sun Sep 10, 2017 10:42 am

Re: How clone VPN settings?

Post by AndrzejB » Sun Jul 14, 2019 1:56 pm

inxi:

Code: Select all

System:    Host: andrzejborucki-ThinkPad-E460 Kernel: 4.15.0-20-generic x86_64
           bits: 64 gcc: 7.3.0
           Desktop: Cinnamon 3.8.9 (Gtk 3.22.30-1ubuntu3)
           Distro: Linux Mint 19 Tara
Machine:   Device: laptop System: LENOVO product: 20EUS00500 v: ThinkPad E460 serial: N/A
           Mobo: LENOVO model: 20EUS00500 serial: N/A
           UEFI [Legacy]: LENOVO v: R00ET47W (1.22 ) date: 09/18/2016
Battery    BAT0: charge: 38.9 Wh 100.1% condition: 38.9/47.0 Wh (83%)
           model: LGC LNV-45N1 status: Discharging
CPU:       Dual core Intel Core i3-6100U (-MT-MCP-) 
           arch: Skylake rev.3 cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 9216
           clock speeds: max: 2300 MHz 1: 500 MHz 2: 500 MHz 3: 500 MHz
           4: 500 MHz
Graphics:  Card: Intel Skylake GT2 [HD Graphics 520] bus-ID: 00:02.0
           Display Server: x11 (X.Org 1.19.6 )
           drivers: modesetting (unloaded: fbdev,vesa)
           Resolution: 1366x768@60.00hz
           OpenGL: renderer: Mesa DRI Intel HD Graphics 520 (Skylake GT2)
           version: 4.5 Mesa 18.2.8 Direct Render: Yes
Audio:     Card Intel Sunrise Point-LP HD Audio
           driver: snd_hda_intel bus-ID: 00:1f.3
           Sound: Advanced Linux Sound Architecture v: k4.15.0-20-generic
Network:   Card-1: Intel Ethernet Connection I219-V
           driver: e1000e v: 3.2.6-k bus-ID: 00:1f.6
           IF: enp0s31f6 state: down mac: <filter>
           Card-2: Intel Wireless 8260 driver: iwlwifi bus-ID: 01:00.0
           IF: wlp1s0 state: up mac: <filter>
Drives:    HDD Total Size: 120.0GB (39.5% used)
           ID-1: /dev/sda model: KINGSTON_SV300S3 size: 120.0GB temp: 33C
           Optical: No optical drives detected.
Partition: ID-1: / size: 110G used: 45G (43%) fs: ext4 dev: /dev/sda1
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 35.0C mobo: N/A
           Fan Speeds (in rpm): cpu: 0
Info:      Processes: 229 Uptime: 23:58 Memory: 3475.2/7459.5MB
           Init: systemd runlevel: 5 Gcc sys: 7.4.0
           Client: Shell (bash 4.4.191) inxi: 2.3.56 
lsusb:

Code: Select all

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 007: ID 138a:0011 Validity Sensors, Inc. VFS5011 Fingerprint Reader
Bus 001 Device 006: ID 04f2:b541 Chicony Electronics Co., Ltd 
Bus 001 Device 004: ID 8087:0a2b Intel Corp. 
Bus 001 Device 005: ID 1c4f:0026 SiGma Micro Keyboard
Bus 001 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 002: ID 1c4f:0034 SiGma Micro 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
If

Code: Select all

sudo apt install openresolv easy-rsa network-manager-openvpn bind9 unbound 
I must install on old or new system?

~/.local/share/networkmanagement/: is not thease directory

/etc/NetworkManager/system-connections/: in file "VPN connection 1" is all but password

User avatar
phd21
Level 19
Level 19
Posts: 9169
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: How clone VPN settings?

Post by phd21 » Sun Jul 14, 2019 2:41 pm

Hi AndrzejB,

You are welcome...

I do not see anything wrong with the results of the "inxi -Fxzd" console terminal command, so that is a good thing.

Install those packages into the new system...

As for where your VPN certificate and key files are stored (after importing) in your Cinnamon system if it is not the directory (folder) I mentioned then it is another folder, perhaps this folder:
~/.cert/nm-openvpn/

This is my KDE system's VPN certificate keys folder
~/.local/share/networkmanagement/

If the NM (network manager's) login passwords are not stored in this folder, then they are stored elsewhere, but I know not where? So, just edit the VPN connection(s) and add your password.
/etc/NetworkManager/system-connections/

Hope this helps ...
Phd21: Mint KDE 18.3 & 19, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram,256gb SDD, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

patrickjburt
Level 1
Level 1
Posts: 16
Joined: Wed Jun 20, 2018 3:45 am

Re: How clone VPN settings?

Post by patrickjburt » Wed Jul 17, 2019 5:58 am

I also wanted to do this, good to have this info in my bucket :D

User avatar
phd21
Level 19
Level 19
Posts: 9169
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: How clone VPN settings?

Post by phd21 » Wed Jul 17, 2019 10:45 am

Hi patrickjburt,

You are welcome...
Phd21: Mint KDE 18.3 & 19, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram,256gb SDD, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

Post Reply

Return to “Other networking topics”