Bernd
February 18, 2020, 5:06pm
10
That was right again @ulmwind . I have now:
/usr/bin/sshpass -p 'Password' ssh -N -o UserKnownHostsFile=/root/known_hosts -L 192.168.1.1:5080:127.0.0.1:3128 USERNAME@SERVER
But now I cannot connect to LuCI with a second browser via 192.168.1.1.
Should I activate something in the OpenWRT Firewall?
ulmwind
February 18, 2020, 5:25pm
11
Sorry, what does it mean 'second' browser?
Bernd
February 18, 2020, 5:30pm
12
I am connected with Firefox (192.168.1.1:5080) to VPN Provider
I cannot connect to LuCI (192.168.1.1) with Chrome.
ulmwind
February 18, 2020, 5:38pm
13
OK, it is interesting. Try to type:
http://192.168.1.1:80
ulmwind
February 18, 2020, 5:53pm
15
And after stopping ssh connection works fine?
Bernd
February 18, 2020, 6:05pm
16
I connect to OpenWrt via PuTTY.
The following commands, for example, have no effect:
/etc/init.d/ssh-pp stop
/etc/init.d/ssh-pp disable
reboot
When I remove ssh-pp via SCP and reboot OpenWrt, then I have access again via chrome
ulmwind
February 18, 2020, 6:10pm
17
OK, stopping we'll discuss later. You should kill process, or write kill command to stop section of file.
It is interesting, could you perform one experiment:
change port in /etc/config/uhttpd on something exotics, like 3000, reboot router, and try to connect to http://192.168.1.1:3000
Bernd
February 18, 2020, 6:15pm
18
I think it was a problem of start priority.
After I changed from START=30 to START=99 it worked.
#!/bin/sh /etc/rc.common
START=99
I'm trying your idea too.
yousong
February 19, 2020, 2:44am
19
I think pservice is worth a try here. It can be convenient for running single command or scripts under procd, without writing init scripts.
It comes with a sample uci config pservice.config
Bernd
February 19, 2020, 10:36pm
20
After changing to START=99, every start priority number works now. I can now connect to LuCI, but I can't reboot the router in LuCI, for example.
How can I write this kill command?
ulmwind:
It is interesting, could you perform one experiment:
change port in /etc/config/uhttpd on something exotics, like 3000, reboot router, and try to connect to http://192.168.1.1:3000
After changing to START=99, I can't go back to START=30, because now every start priority number works. I can no longer reproduce the issue.
I do not know how to install the package on OpenWrt.
Where should I enter the ssh command in the sample?
yousong
February 20, 2020, 4:30am
21
The following should do. It can also be done through LuCI, "System -> Software"
opkg update
opkg install pservice
The following is an example. Mind the quoting.
config pservice
option name 'demo0'
option respawn_maxfail 0
option command /bin/sh
list args -c
list args 'exec /usr/bin/sshpass -p "Password" ssh -N -o UserKnownHostsFile=/root/known_hosts -L 192.168.1.1:5080:127.0.0.1:3128 USERNAME@SERVER'
Docs for each option are also available in the link provided.
ulmwind
February 20, 2020, 8:32am
22
Post output of
ps | grep ssh
Bernd
February 20, 2020, 11:43am
23
root@OpenWrt:~# ps | grep ssh
22047 root 744 S sshpass -p zzzzzzzzzzzz ssh -N -o UserKnownHostsFile
22048 root 3444 S ssh -N -o UserKnownHostsFile=/root/known_hosts -L 19
22113 root 1120 S grep ssh
ulmwind
February 20, 2020, 11:53am
24
OK, now try manually to kill like:
kill 22047
kill 22048
After that we'll write script.
1 Like
Bernd
February 20, 2020, 11:55am
25
yousong:
The following should do. It can also be done through LuCI, "System -> Software"
opkg update
opkg install pservice
I have OpenWrt 19.07.1. Here is the output:
Unknown package 'pservice'.
Collected errors:
* opkg_install_cmd: Cannot install package pservice.
yousong
February 20, 2020, 1:48pm
26
This is unfortunate. At the moment you can try the following as stated in another thread. I will see if I can find time to do the backport.
1 Like
Bernd
February 21, 2020, 11:13am
27
Thanks again for help @yousong .
Pservice works without any problems. Restart pservice configuration automatically when the http-proxy goes down?
yousong
February 21, 2020, 11:41am
28
Procd will bring it up according to respawn settings.
pservice is just a thin wrapper for adding random commands or scripts as procd service instances.
system
Closed
March 2, 2020, 11:41am
29
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.