Open Jorman opened 6 years ago
Tried to install, works!
Tried to configure, don't
sudo: unknown user: root
sudo: unable to initialize policy plugin
Traceback (most recent call last):
File "/opt/bin/openpyn", line 11, in <module>
load_entry_point('openpyn==2.6.0', 'console_scripts', 'openpyn')()
File "/opt/lib/python3.6/site-packages/openpyn/openpyn.py", line 130, in main
args.skip_dns_patch, args.silent, args.nvram, args.openvpn_options)
File "/opt/lib/python3.6/site-packages/openpyn/openpyn.py", line 165, in run
initialise()
File "/opt/lib/python3.6/site-packages/openpyn/openpyn.py", line 349, in initialise
credentials.save_credentials()
File "/opt/lib/python3.6/site-packages/openpyn/credentials.py", line 32, in save_credentials
subprocess.check_call(["sudo", "chmod", "600", credentials_file_path])
File "/subprocess.py", line 291, in check_call
subprocess.CalledProcessError: Command '['sudo', 'chmod', '600', '/opt/lib/python3.6/site-packages/openpyn/credentials']' returned non-zero exit status 1.
Any idea?
Hi Jo,
Thanks.
1 There's any plan or any way to "select" which service go over the vpn? Ans: Not within openpyn But check out https://github.com/mrahmadt/SmartGW
2: no idea mate.
In this case, you can't seem to run commands as sudo command
as your system doesn't have user 'root' in it. maybe create a user called root and give it root permissions. openpyn uses a lot of commands as sudo command
to gain root access for changing iptables, running openvpn, etc..
I can't just have the script run as root cause that way you can't have desktop notifications. that's the way things are unfortunately.
Thanks I'll look into it!
Not possible to implement some flag, like the one for asus, to skip this command as sudo? So maybe you can handle with one or more flag this situation and the one for entware systems, this one https://github.com/jotyGill/openpyn-nordvpn/issues/168#issuecomment-417552572
What do you think?
would have been easy if it was a few commands. throughout the program there would be >50 commands being run as sudo. I'll see what I can do
Wow! A lot of commands.
I don't know if simply installing sudo and run the program like root can be enough
Most of them are for the '-f' switch anyway. give it a go.
Same problem here on asus-merlin.. Cannot even run init and add a credential file as it says there is no root user. How can I do?
@xmflsct Have you followed instructions as outlined in README
# common dependencies
opkg install git git-http iputils-ping procps-ng-pgrep python3 python3-pip sudo unzip wget
cd /tmp/share/
git clone https://github.com/jotyGill/openpyn-nordvpn.git
cd openpyn-nordvpn/
git pull
pip3 install --upgrade setuptools
pip3 install --upgrade .
@1951FDG Yes, installation is completed, and I can run openpyn -h
without problem.
When I run openpyn --init
after I typed in my username and password, it terminated saying that there is no root user in sudoers. I can see that credential file has been generated. It seems like asus-merlin does not allow to have a user named root.
@xmflsct have you been able to run openpyn --init
? I currently stuck on the below error on Asus merlin, installation all OK.
Enter the password for NordVPN:
sudo: unknown user: root
sudo: unable to initialize policy plugin
Traceback (most recent call last):
File "/opt/bin/openpyn", line 33, in <module>
sys.exit(load_entry_point('openpyn==2.7.5', 'console_scripts', 'openpyn')())
File "/opt/lib/python3.9/site-packages/openpyn/openpyn.py", line 138, in main
return_code = run(
File "/opt/lib/python3.9/site-packages/openpyn/openpyn.py", line 156, in run
initialise(log_folder)
File "/opt/lib/python3.9/site-packages/openpyn/openpyn.py", line 442, in initialise
credentials.save_credentials()
File "/opt/lib/python3.9/site-packages/openpyn/credentials.py", line 42, in save_credentials
subprocess.check_call(["sudo", "chmod", "600", credentials_file_path])
File "/opt/lib/python3.9/subprocess.py", line 373, in check_call
subprocess.CalledProcessError: Command '['sudo', 'chmod', '600', '/opt/lib/python3.9/site-packages/openpyn/credentials']' returned non-zero exit status 1.
Thanks for help
@salvq sorry I am not using this library anymore.
@salvq sorry I am not using this library anymore.
I see, have you found some alternative for asus merlin ?
Thanks
@salvq Nope. I was using mannual OpenVPN settings for a while before switching to running NordVPN on my Raspberry Pi.
@salvq
I'm the maintainer for the Asus Merlin part of the code
A change was made in the latest test branch to address the fact that some systems don't have a user named root: https://github.com/jotyGill/openpyn-nordvpn/commit/f0bd26a5fd8d70bc51423c13bf46ed9adee436d8#diff-a925c95e804261d8dcf5a2768740fe03e3c9de4edd0d3acbc111d88cf91013fd
Allow admin user to run sudo
sed -i 's~root ALL=(ALL) ALL~admin ALL=(ALL) ALL~g' /opt/etc/sudoers
Install the test branch
cd /tmp/share/
git clone --branch test https://github.com/jotyGill/openpyn-nordvpn.git
cd openpyn-nordvpn/
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade .
Always also refer to the readme of the test branch, which is the most up to date readme: https://github.com/jotyGill/openpyn-nordvpn/blob/test/README.md
Thanks for the help
Hi, I just discovered this script and I think is quite good for my purpose, seems very good script!
I'm on a qnap system and qnap offer only qvpn service, an application where I've to load the openvpn profile and manually connect to it, so I've always to check if the connection are good and don't "risk" to use my ip.
So my "hope" is to make it automatic, like I give to the script my nordvpn credential, then the script connect to the vpn and if the connection go down, switch to another server.
I think that is pretty much the function that the script do, but I've 2 questions
There's any plan or any way to "select" which service go over the vpn?
Anyone have installed this on a Qnap system? Is based on entware and I've this available
Jo