maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Openvpn Applet (https://talk.maemo.org/showthread.php?t=20921)

jgombos 2008-11-27 22:50

Re: Openvpn Applet
 
Quote:

Originally Posted by mikkov (Post 245151)
Thanks for the report. I will try to investigate this problem later.

Until I fix the problem you can copy configuration files directly to /etc/openvpn directory. Applet should see the .conf or .ovpn file from there.

That doesn't work either. That's where I had my configuration to begin with.

Currently I go to /etc/openvpn and execute
Code:

openvpn --config openvpn.conf
from the commandline to start the tunnel. It's a pain to do that every time though. I guess I need to write a script and find a way to trigger it from the gui.

mikkov 2008-11-27 22:53

is the .conf file readable by user?

jgombos 2008-11-28 09:12

Re: Openvpn Applet
 
Quote:

Originally Posted by mikkov (Post 245157)
is the .conf file readable by user?

Yes, both the copy on the MMC card, and the copy in /etc/openvpn.

Strangely, the files on the mmc card are owned by "user", but they are in the "root" group. The permission bits are 644. I logged in as root and tried to "chown root:users *", but got operation not permitted. I suppose that's not the problem, because the files on the mmc chip are readable by all.

The files in /etc/openvpn are owned by root:users, and have permission bits 640. So there is no reason why the applet would have trouble accessing the files.

mikkov 2008-11-28 16:26

ok, what are permissions for /etc/openvpn directory itself? They should be for example 755.

jgombos 2008-11-28 17:13

Re: Openvpn Applet
 
Quote:

Originally Posted by mikkov (Post 245338)
ok, what are permissions for /etc/openvpn directory itself? They should be for example 755.

That was it! The applet finds the tunnel configuration now.

/etc/openvpn was owned by root:root w/ permissions 700. I changed ownership to root:users w/ permission bits 750.

It's a quick fix. From a security standpoint, I think only root should see these files. Should the 's' bit be set on the applet?

mikkov 2008-11-28 17:32

Re: Openvpn Applet
 
I think that /etc/openvpn directory's 755 permission bits are default for many distributions including maemo.org's openvpn package (if it hasn't changed), but I can understand your view.

Problem with openvpn applet is that is is running inside hildon-desktop and it is always running as user. Applet needs to be able to read the configuration file and directory listing of /etc/openvpn, but it doesn't need to be able to read certificates or keys. For importing files and starting openvpn process it uses sudo.

jgombos 2008-12-02 15:00

Re: Openvpn Applet
 
I notice that the instant START is tapped, the icon turns green well before it could connect successfully. And it remains green, even if I shutdown the network. So what is the icon telling us?

FEATURE REQUEST:

To get an idea of how the tunnel is working, I generally run something like: "tail -f /var/log/openvpn.log" (the logfile is specified by the "log" key in the config file). It would indeed be useful if the openvpn applet gave the user a way to request a detailed status, which could simply involve launching an xterm that runs the tail command on whatever log is mentioned in the config file.

Sometimes I just want to see what my IP address is. So I scroll through my bookmarks for a website that will echo that back to me. It gives me a relatively quick way of confirming whether the tunnel is working. It would be useful if such a webpage could be launched directly from the applet.

mikkov 2008-12-02 17:16

Re: Openvpn Applet
 
Quote:

Originally Posted by jgombos (Post 246256)
I notice that the instant START is tapped, the icon turns green well before it could connect successfully. And it remains green, even if I shutdown the network. So what is the icon telling us?

It is looking for the pid file. After about 30 seconds it stops scanning the pid file and updates only when you select the connection from drop down list or use the stop button. So it isn't aware of network connection or even openvpn connection at all, but it's on my "todo" list to make it better.

Quote:

FEATURE REQUEST:

To get an idea of how the tunnel is working, I generally run something like: "tail -f /var/log/openvpn.log" (the logfile is specified by the "log" key in the config file). It would indeed be useful if the openvpn applet gave the user a way to request a detailed status, which could simply involve launching an xterm that runs the tail command on whatever log is mentioned in the config file.
Test button in settings dialog is close to this, but as it restarts the connection every time (and dialog is modal to hildon-desktop) it's not exactly useful for this purpose. But this is a good idea and I think about it when I have the motivation to do something for applet.



Quote:

Sometimes I just want to see what my IP address is. So I scroll through my bookmarks for a website that will echo that back to me. It gives me a relatively quick way of confirming whether the tunnel is working. It would be useful if such a webpage could be launched directly from the applet.
This kind of feature would be very nice, but I would see that it fits better for example for homeip applet.

heavyt 2009-12-29 19:27

Re: Openvpn Applet
 
I am trying to use openvpn to tunnel my sip/voip (Gizmo, Sipgate etc) from N810 to any openvpn server. Openvpn works fine and sip/voip works fine but it fails when openvpn is used. Are there scripts that can be used as a solution? The ones at https://bugs.maemo.org/show_bug.cgi?id=1860 seem not to work or I am doing it wrong. :confused:

TA-t3 2009-12-30 11:51

Re: Openvpn Applet
 
I take it you've got it resolved now? There was a reply in the bug thread and I too replied in that other thread (summary: set "script-security 2" to openvpn config file, add 'x' bit (chmod u+s) to your scripts).

EDIT: I meant u+x of course, u+s was a typo.. that's something entirely different and won't work on scripts.

heavyt 2010-01-01 20:44

Re: Openvpn Applet
 
Quote:

Originally Posted by TA-t3 (Post 446493)
I take it you've got it resolved now? There was a reply in the bug thread and I too replied in that other thread (summary: set to , add 'x' bit (chmod u+s) to your scripts).

Yes I got it to work and thanks for your help. I used chmod +x, I read that chmod u+s doesn't work for scripts. I also found that trying to run more than one sip (my case it was sipgate and gizmo tied into Google Voice) seem to make them not reliable. I also added "script-security 2 system" to the openvpn config file. Now my N810-WE is humming! :cool:

TA-t3 2010-01-01 21:00

Re: Openvpn Applet
 
Ops, u+s was a typo (s is the sticky bit, and won't work on scripts, as you said. I did mean u+x. Updated my post above.)

rocketscientist 2010-07-07 14:59

Re: Openvpn Applet
 
Just a happy user posting! It works! :-)

heavyt 2010-07-07 15:22

Re: Openvpn Applet
 
Quote:

Originally Posted by rocketscientist (Post 743783)
Just a happy user posting! It works! :-)

Nice to hear, what NXXX?

pm_home 2010-09-16 10:08

Re: Openvpn Applet
 
Hi ! I'v got everything working fine and have no problems running from console (e "/usr/sbin/openvpn /etc/openvpn/your_config"), BUT have this problem that the applet dissapears from Status bar. Uninstalling and re-installing gets it back - Does anybody have a solution on this problem ??

mikkov 2010-09-16 10:43

Re: Openvpn Applet
 
Quote:

Originally Posted by pm_home (Post 817715)
Hi ! I'v got everything working fine and have no problems running from console (e "/usr/sbin/openvpn /etc/openvpn/your_config"), BUT have this problem that the applet dissapears from Status bar. Uninstalling and re-installing gets it back - Does anybody have a solution on this problem ??

When does it disappear? What are the permissions in /etc/openvpn directory? There is very likely a bug in the applet.

pm_home 2010-09-16 15:00

Re: Openvpn Applet
 
Quote:

Originally Posted by mikkov (Post 817739)
When does it disappear? What are the permissions in /etc/openvpn directory? There is very likely a bug in the applet.

Hi ! It dissapears after reboot (eg turning off and on N900). I'm a newbie to Linux s 2 good at permission-stuff BUT I installed rootsh, ran sudo gainroot, cd /etc, sudo chmod 777 openvpn, turned off the N900 and started it again, BUT no applet in statusbar. SO it's there after installation (and works nicely over 3G :-)), BUT as soon as I restart machine the applet is gone :-(

mikkov 2010-09-16 15:37

Re: Openvpn Applet
 
Quote:

Originally Posted by pm_home (Post 817954)
Hi ! It dissapears after reboot (eg turning off and on N900). I'm a newbie to Linux s 2 good at permission-stuff BUT I installed rootsh, ran sudo gainroot, cd /etc, sudo chmod 777 openvpn, turned off the N900 and started it again, BUT no applet in statusbar. SO it's there after installation (and works nicely over 3G :-)), BUT as soon as I restart machine the applet is gone :-(

OK. It's possible that some other plugin is causing the problem. Do you have any other status menu plugins installed? If you have, try removing them. Note that if something else is crashing, you never have a chance to to see it in status bar.

pm_home 2010-09-16 15:52

Re: Openvpn Applet
 
Quote:

Originally Posted by mikkov (Post 817986)
OK. It's possible that some other plugin is causing the problem. Do you have any other status menu plugins installed? If you have, try removing them. Note that if something else is crashing, you never have a chance to to see it in status bar.

Hi ! BIG Thks - you were absolutely right - when I uninstalled Tor-applet YOUR/OpenVPN-applet applet came right back :) - didn't even have to restart. Do u have any idea where/if one can edit the loadingorder of applets - maybe that could do the trick !!

mikkov 2010-09-16 17:39

Re: Openvpn Applet
 
Quote:

Originally Posted by pm_home (Post 817993)
Hi ! BIG Thks - you were absolutely right - when I uninstalled Tor-applet YOUR/OpenVPN-applet applet came right back :) - didn't even have to restart. Do u have any idea where/if one can edit the loadingorder of applets - maybe that could do the trick !!

Tor applet and OpenVPN applet are working together fine for me. I don't believe that loading order is any help here.

Quasar 2010-12-09 20:31

Re: Openvpn Applet
 
Is it possible to add something like "status of VPN connection" to status-menu? Now you can't see, if the connection is established or not (on the desktop I mean).

Laughing Man 2010-12-24 02:26

Re: Openvpn Applet
 
This may be off-topic. But is it possible to have two VPN connections running on the N900? I'll describe why first. Currently I'm debating should I use a free OpenVPN provider or just run two of my own. Why two? Well one is at my parents' home and the other is at the apartment. At any time, one or both may be offline. I'd like to have the N900 try to connect to either one of them.

Reason why I want to use OpenVPN (retrieval and accessing it remotely in case it gets misplaced to delete files). Since it's on T-Mobile USA and behind a NAT I can't access it directly with SSH. I could try reverse SSH though (I suppose if I figured how to set it up).

Sorry if it's off-topic.

mikkov 2010-12-30 21:01

Re: Openvpn Applet
 
Quote:

Originally Posted by Laughing Man (Post 903233)
This may be off-topic. But is it possible to have two VPN connections running on the N900?

It is possible to have two openvpn connections open at the same time, no problem. If I understood correctly you wish have them open always automatically. It is possible too, but not with OpenVPN Applet, because it doesn't support "always on" connections from the boot you'll need to start them manually.

mikkov 2010-12-30 21:05

Re: Openvpn Applet
 
Quote:

Originally Posted by Quasar (Post 893522)
Is it possible to add something like "status of VPN connection" to status-menu? Now you can't see, if the connection is established or not (on the desktop I mean).

There is little icon in status area when openvpn is active. But it doesn't tell if connection is really established or is it still trying to connect.

Quasar 2010-12-31 10:03

Re: Openvpn Applet
 
Quote:

Originally Posted by mikkov (Post 907867)
There is little icon in status area when openvpn is active. But it doesn't tell if connection is really established or is it still trying to connect.

Yes, I know. But I would like to see if connection established is or not.

Sorry for my English..

mikkov 2010-12-31 12:17

Re: Openvpn Applet
 
It is not too hard to add "connecting" icon. I'll see if there is enough small fixes to made for a new release.

rajil.s 2011-02-09 17:38

Re: Openvpn Applet
 
@Mikkov,

Is it possible to execute the applet from command-line? The reason i want to do this is that i want to start openvpn before i connect to wifi.

I was going to script something in /etc/network/if-pre-up.d/ but didnt want to use the openvpn script init script since it logs to syslog by default. With the applet it is easier to check the status. It will be awesome if it were possible to start and stop applet via command-line.

Thanks

mikkov 2011-02-16 22:17

Re: Openvpn Applet
 
Quote:

Originally Posted by rajil.s (Post 940150)
Is it possible to execute the applet from command-line?

There used to be very simple text mode ui, but it wasn't exactly command line interface and it wouldn't work the you are hoping for. So the answer is no.

hansaka 2011-03-04 02:59

Re: Openvpn Applet
 
hi guys i just installed openvpn-applet to n900 but it seems like it doesn't get an local ip and i cant ping the other end but on my desktop machine for same configuration file it get connected and i get an IP from server. on n900 it shows that i have connected and even from server side without an issue but no ip adress. To make sure i tryed with my DNS records whether there is an entry, no luck so far.... help me over here

cct 2011-05-23 15:11

Re: Openvpn Applet
 
Quote:

Originally Posted by gochito (Post 215038)
Done! ... Created the password file in the /etc/openvpn directory...

included askpass /etc/openvpn/password

in my .conf file and Voila! Working as a charm!

Thanks a lot!

Hi, could you publish the syntax of your config-file to compare mine with it, please? I am getting a socket.connect() failed thingy now, I must have messed it up.

cheers!

EDIT:

I have been experimenting around with stuff like

Code:

auth-user-pass /etc/openvpn/password.txt via-file
and
Code:

askpass /etc/openvpn/password.txt
and similar things, but I realize I am unfamiliar with the syntax and reading up on it is not as easy as I thought. The password.txt file contains user and password blank delimited and just for one person. I am not concerned about putting these bits on my N900, as I am using it only scarcely.

I might add, that if I leave OpenVPN as it is and edit in the user/pass combination with my VPN provider, it works flawless. Just the given pass and user combination is hellishly stupid to edit in every time.

cct 2011-05-23 16:20

Re: Openvpn Applet
 
answering myself - maybe some other kind soul will save some minutes.

Tried opening openvpn form shell, which gave me the necessary input:

the password file needs to have the user in one line, passwort after carriage return.

Using complete paths in the config file also was of great help to make it work (I am keeping the certs etc in a subdirectory of openvpn to make things digestible).

config file now goes like this:
Code:

client
dev tun
fast-io
persist-key
persist-tun
nobind
remote vpn.snugglysnugglyplace.co.uk 1194
pull
comp-lzo
tls-client
tls-remote server
ns-cert-type server
tls-auth /etc/openvpn/ssl/ta.key 1
ca /etc/openvpn/ssl/ca.crt
cipher AES-256-CBC
verb 3
mute 10
auth-user-pass /etc/openvpn/password via-file


sm8ps 2011-11-05 20:21

Re: Openvpn Applet
 
Hi Mikko,
first off many thanks for this nifty little time saver! (I hope that still somebody is following this thread!(?))
For others' information, I had the same problem as user pm_home in post 59: the applet did not consistently show up in the status bar. I deleted the wifi-switch (?) applet and now openvpn-applet does show up. Could it be a general thing about too many applets maybe? (Has anybody seen the status menu bar providing slider bars?) Anyways, I hope it will stay visible as I am certain to make quite some use of it.
Cheers!
St. Mueller, Switzerland

mikkov 2011-11-05 21:57

Re: Openvpn Applet
 
I do randomly watch this thread, nice to hear that you like the applet.

I have heard couple of times before that applet isn't showing up until some other applet is removed. I have looked into it, but frankly haven't found any reason for it or seen it myself.

sm8ps 2011-11-16 12:38

Re: Openvpn Applet
 
Mikkov,

thanks for your reply! By coincidence I found out that the status menu bar does indeed provide a sliding functionality. That is, if there are too many applets, one can scroll but there are no slider bars visible so that you won't realize there are additional applets (at least I did not until after two years of using my n900 ...). Since the OpenVPN applet seems to be added towards the bottom of the menu bar area it seems to be susceptible for being hidden down below.

Hope this helps others.

Cheers!
St. Mueller, Switzerland

bocephus 2011-12-18 13:16

Re: Openvpn Applet
 
I tried using openvpn to connect to my Ivacy account with these configuration files, but all I get is

Code:

Cannot load certificate file ivacy-keys/ivacy-client.crt: error:0906D06C:PEM routines:PEM_read_bio:no start line: error:140AD009:SSL routines:SSL_CTX_use_certificate_file:PEM lib
What could be the problem?

Also, if I set

Code:

auth-user-pass /etc/openvpn/password via-file
in the configuration file, what format should be in the pass-file? username:password?

sm8ps 2011-12-18 17:43

Re: Openvpn Applet
 
Hey bocephus
Just a quick shot in the dark: I would try specifying the full path of the files. I put mine under '/home/user/.ssl/' for instance.

Cheers!
St. Mueller, Switzerland

bocephus 2011-12-18 19:52

Re: Openvpn Applet
 
Well, I've tried that just to be sure, but that's not the problem. The error is not "not found", it's "PEM_read_bio:no start line". I suspect it might be encoding related. Does Leafpad save in UTF or ANSI? The latter might be preferable.

Edit: Nope. I saved all files in Unix ANSI in Notepad++ but I still get the same error.


All times are GMT. The time now is 10:31.

vBulletin® Version 3.8.8