I use vpnc to login to my company VPN(Cisco). It was all working fine. Recently, I had changed my laptop and so I had to install vpnc again. After installing vpnc when I tried to connect, it threw me a 'permission denied' error as shown below:
[root@raghu-ti8105 raghu]# vpnc ./vpn
Enter password for raghu@mycompany.com:
sh: /etc/vpnc/vpnc-script: Permission denied
sh: /etc/vpnc/vpnc-script: Permission denied
VPNC started in background (pid: 6986)...
[root@raghu-ti8105 raghu]#
I searched the internet and found a few 'permission denied' threads however nothing worked for me. To make it work, I decided to login using the Windows Cisco VPN Client. Once connected, I can convert the profile(*.pcf) file using 'pcf2vpnc' script to a vpnc conf file and try again with vpnc.
I was able to login from Windows however it still didn't work with vpnc. That's when I decided to look closely at the error.
It was a 'permission denied' error from the shell. The user running did not have permission to run the script!!!
The solution was to allow the owner of the script to execute.
chmod u+x /etc/vpnc/vpnc-script
After running the above command, I ran vpnc again.
[root@raghu-ti8105 raghu]# vpnc ./vpn
Enter password for raghu@mycompany.com:
Connect Banner:
| UNAUTHORIZED USERS WILL BE PROSECUTED TO THE FULL EXTENT OF THE LAW.
|
VPNC started in background (pid: 7260)...
[root@raghu-ti8105 raghu]#
Note: I believe by default the /etc/vpnc/vpnc-script is installed with execute privilege for the owner but it did not happen in my case, not sure why.