![]() |
2007-07-20
, 10:12
|
Posts: 3,841 |
Thanked: 1,079 times |
Joined on Nov 2006
|
#12
|
![]() |
2007-07-20
, 16:05
|
|
Posts: 641 |
Thanked: 27 times |
Joined on Apr 2007
|
#13
|
If openvpn is in /usr/sbin then it sounds to me like /usr/sbin is not in $PATH after the sudo gainroot. If so, change that line
openvpn --config /etc/openvpn/openvpn.conf
to
./openvpn --config /etc/openvpn/openvpn.conf
(well, that's one way -- another is to fix the PATH. but the above should work everywhere.)
./vpn: ./vpn: 4: ./openvpn: not found
![]() |
2007-07-20
, 18:05
|
Posts: 17 |
Thanked: 1 time |
Joined on Jul 2007
|
#14
|
![]() |
2007-07-20
, 21:25
|
|
Posts: 641 |
Thanked: 27 times |
Joined on Apr 2007
|
#15
|
The script should work, but I don't know why you guys are using relative paths and changing directories in your shell scripts. Do it the clean way: use absolute paths. that would save a lot of posting.If it helps, here's my version of a shell script that works just great. And remember, a shell script just executes commands for you, so if you can execute the commands in a shell by hand, then you can do it in a script. Just don't get mixed up with relative paths:
VPN Script:
#!/bin/sh
/usr/bin/op
openvpn --config /etc/openvpn/config.conf &
Notice the "&" to background the process. And you're probably asking what "/usr/bin/op" is. It's just another shell script:
#!/bin/sh
sudo gainroot
The only reason it is another shell script is because sometimes I want to become root and don't want to type more than two characters--especially when i have to use that blasted on screen stylus keyboard with my thumbs. "op" is easy to type and it's near the enter key..
~ $ ./vpn Root shell enabled BusyBox v1.4.1 (2007-03-12 19:00:25 EET) Built-in shell (ash) Enter 'help' for a list of built-in commands. /home/user # /home/user # exit Fri Jul 20 13:19:22 2007 OpenVPN 2.0.7 arm-unknown-linux [SSL] [LZO] [EPOLL] built on Jul 17 2006 Fri Jul 20 13:19:22 2007 IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA. OpenVPN 2.0-beta16 and earlier used 5000 as the default port. Enter Private Key Password: Fri Jul 20 13:19:27 2007 Error parsing PKCS#12 file Nokia.p12: error:23076071:lib(35):func(118):reason(113): error:23076071:lib(35):func(118):reason(113) Fri Jul 20 13:19:27 2007 Error: private key password verification failed Fri Jul 20 13:19:27 2007 Exiting ~ $
![]() |
2007-07-20
, 22:35
|
Posts: 13 |
Thanked: 7 times |
Joined on Jul 2007
@ Wuppertal, Germany
|
#16
|
![]() |
2007-07-20
, 23:49
|
|
Posts: 641 |
Thanked: 27 times |
Joined on Apr 2007
|
#17
|
sudo gainroot starts another shell process rather than raising
the privileges of the existing one.
A quick solution would be to make openvpn suid root as in
chmod 4755 /usr/sbin/openvpn
It does work if I run it manually.
Here's what it does.
Just because you are online, doesn't mean you don't have to form a full sentence.
SEARCH! It's probably already been answered.
Last edited by barry99705; 2007-07-19 at 16:30.