You are not logged in.
Hi All,
as network connection manager I use wicd. I basically always use a vpn connection with vpnc; so I have created a myvpn.conf file for vpnc and I launch my vpn by
sudo vpnc myvpn
after which of course I need to input my sudo password. I would like this process to be automatically run at startup without having to type in the command and the password all the time.
Using network-manager one can select to automatically connect to a vpn for a specific network, however I would like this to be done for all connections. Furthermore, I have had various problems with network-manager in the past and have abandoned it in favour of wicd and I am looking for a solution using wicd...
Do you have any suggestions on how to do this?
Thanks in advance for your help!
PS: Always more amazed by BL the more I use it...seems like I've found my distro :-D
Last edited by ap (2017-08-31 08:45:59)
Offline
You can run sudo applications without a password by editing the sudoers file. Always edit this file with
sudo visudo
Add something like this to the bottom of the file...
YOURNAME ALL = NOPASSWD: /path/to/executable
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Hi All,
as network connection manager I use wicd. I basically always use a vpn connection with vpnc; so I have created a myvpn.conf file for vpnc and I launch my vpn bysudo vpnc myvpn
after which of course I need to input my sudo password. I would like this process to be automatically run at startup without having to type in the command and the password all the time.
Using network-manager one can select to automatically connect to a vpn for a specific network, however I would like this to be done for all connections. Furthermore, I have had various problems with network-manager in the past and have abandoned it in favour of wicd and I am looking for a solution using wicd...
Do you have any suggestions on how to do this?
Thanks in advance for your help!PS: Always more amazed by BL the more I use it...seems like I've found my distro :-D
Arch comes with this vpnc service file, /usr/lib/systemd/system/vpnc@.service:
[Unit]
Description=VPNC connection to %i
Wants=network-online.target
After=network.target network-online.target
[Service]
Type=forking
ExecStart=/usr/bin/vpnc --pid-file=/run/vpnc@%i.pid /etc/vpnc/%i.conf
PIDFile=/run/vpnc@%i.pid
[Install]
WantedBy=multi-user.target
So, in order to have your VPN autostart from the configuration file /etc/vpnc/myvpn.conf, you'd do:
systemctl enable vpnc@myvpn
systemctl start vpnc@myvpn
Note: network-online.target only works correctly when used with a fitting network manager, IIRC this is only network-manager at the moment.
On my system, I always start it manually.
Offline
Thanks for the great help, I am not on arch but it's interesting to know that they provide that vpnc service file. However, following damo's suggestion this is now sorted :-D
I have added YOURNAME ALL = NOPASSWD: /path/to/executable to my sudoers file and then add a .desktop entry to autostart the script and it works as requested.
I have a further question, how can I delay the execution of the script, say for example of 5 seconds? Wicd takes a bunch of seconds to connect and I need to wait for it to be connected, so how can I autostart my vpn after wicd is connected?
Thanks!
Offline
Ok, sorted it myself...I have added "sleep 5" to the .sh script...I will change the thread as solved!
Offline