Index  | Recent Threads  | Unanswered Threads  | Who's Active  | Guidelines  | Search
 

Quick Go »
No member browsing this thread
Thread Status: Active
Total posts in this thread: 11
Posts: 11   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 2118 times and has 10 replies Next Thread
a_mobile_humanist
Cruncher
Joined: May 20, 2011
Post Count: 34
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Connecting BOINC Manager thru an SSH tunnel [RESOLVED]

Hello everyone.

I currently run three BOINC clients on three Windows machines on my local network. I control the three clients from one machine, by connecting an instance of BOINC Manager to each client over the network. Everything is currently set up and runs in the normal manner according to the instructions I found on the BOINC wiki at Berkeley: https://boinc.berkeley.edu/wiki/Controlling_BOINC_remotely . So, I already know that I have BOINC configured for remote control properly to begin with.

Now, what I would like to do is connect to each of my BOINC clients over an SSH tunnel, so that connecting a BOINC Manager to a client 1) requires successful authentication as a legitimate user on the client machine, and 2) all BOINC communications on my network are encrypted. I've seen rumors to the effect that BOINC Manager can successfully connect over an SSH tunnel, but I say "rumors" because none of my Googling so far has produced any actual instructions for doing so.

My attempt so far involved installing cygwin on each machine, installing openssh on each, installing and configuring sshd as a Windows service on the client machines, and configuring firewalls to allow inbound ssh connections on the same. All of this was done without problem or error. So, on the machine where I wish to run BOINC Manager, I issue the following command in a cygwin shell to create a tunnel to one of the client machines:

ssh -D 4242 myuser@192.168.1.101

Then, in BOINC Manager, I select "Advanced" then "Select Computer..." and use "localhost:4242" for the host name and enter the appropriate password. However, BOINC Manager does not appear to recognize the specified port number, and fails to connect. I know that port 4242 is established and that the SSH tunnel is connected because Firefox does see it and I can configure Firefox to use it as a SOCKS proxy.

I've found another thread on SSH tunneling (https://secure.worldcommunitygrid.org/forums/...ead,22994_offset,0#198735) which hints at setting up a SOCKS proxy for BOINC, but, again, details seem to be lacking. The only option I see in BOINC Manager for SOCKS proxies (Tools -> Options... -> SOCKS Proxy) seems only to be available if Manager is already connected to a BOINC client, which seems to defeat the purpose.

So, is there anyone out there using SSH tunnels who might have an idea what I'm doing wrong? Thanks for any help!
----------------------------------------
[Edit 1 times, last edit by a_mobile_humanist at Sep 26, 2012 7:18:09 AM]
[Sep 16, 2012 9:51:03 AM]   Link   Report threatening or abusive post: please login first  Go to top 
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
Re: Connecting BOINC Manager thru an SSH tunnel

In some set ups it has to be in others it does not [dont know the criteria], but certainly I've found for myself to need to add the IP local/remote IP addresses into the remote_hosts.cfg file [placed in the BOINC data directory [I maintain a master copy, which I replicate around to all clients when I make a change to it], whilst I use a reserved IP DHCP method, to ensure that each client maintains the same IP address. Also in my case, I then just issue the IP address or the device name into the select computer "host" box, with a standard password [same on all hosts as entered into the gui_rpc_auth.cfg file].

Critical ports are 31416 default or other port you define for a client to communicate it's RPC over. I just use port 31416 for all devices i.e. no config required.

Much simpler is though to use BOINCTasks, a 3rd party multiclient BOINC manager. Once you've set up a client connection, the manager just checks periodically if the device is up and connects automatically. At a glance in the computer view you see all your running hosts and which have connection issues. Runs native on Windows or in VM on Linux or Mac, even now on mobiles [Android ?].
[Sep 16, 2012 10:20:10 AM]   Link   Report threatening or abusive post: please login first  Go to top 
a_mobile_humanist
Cruncher
Joined: May 20, 2011
Post Count: 34
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Connecting BOINC Manager thru an SSH tunnel

In some set ups it has to be in others it does not [dont know the criteria], but certainly I've found for myself to need to add the IP local/remote IP addresses into the remote_hosts.cfg file [placed in the BOINC data directory [I maintain a master copy, which I replicate around to all clients when I make a change to it], whilst I use a reserved IP DHCP method, to ensure that each client maintains the same IP address. Also in my case, I then just issue the IP address or the device name into the select computer "host" box, with a standard password [same on all hosts as entered into the gui_rpc_auth.cfg file].


I have gui_rpc_auth.cfg set up properly, and the connection does occur normally when I am not attempting to use an SSH tunnel, so I don't think that this is the problem. I would think that I wouldn't have to change the IP address in gui_rpc_auth.cfg, ...

...actually, that's not true, since when the packets leave the SSH tunnel, they will appear to be originating from the machine at the end of the tunnel, not the beginning, so gui_rpc_auth.cfg might actually be misconfigured. d oh

Thanks for the brainstorm, SekeRob. I'll experiment some more and see if this is the solution.
[Sep 16, 2012 7:48:36 PM]   Link   Report threatening or abusive post: please login first  Go to top 
a_mobile_humanist
Cruncher
Joined: May 20, 2011
Post Count: 34
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Connecting BOINC Manager thru an SSH tunnel

OK, so that wasn't the problem.

Back to basics:

1) Is it possible to specify an arbitrary port when connecting BOINC Manager to a remote computer?

For example, when I go to "Advanced..." and "Select Computer..." can I enter "192.168.1.101:4242" and expect BOINC Manager to look for a BOINC client at 192.168.1.101 port 4242?

2) Is it possible to specify an arbitrary port on localhost in the same manner? This would be necessary for the SSH tunnel scheme I am trying to get working.

So far, BOINC Manager seems to completely ignore any specified port when I try to connect to localhost. It seems to refuse to see anything other than the local boinc client (at the default port 31416) when dealing with localhost. Which seems like bad behavior to me. Or, at least, it is the only network-aware program I've encountered that behaves this way; In my experience, SSH tunnels are normally trivially easy to set up and use.
[Sep 16, 2012 8:24:07 PM]   Link   Report threatening or abusive post: please login first  Go to top 
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
Re: Connecting BOINC Manager thru an SSH tunnel

A port over which *GUI* RPC is send can be specified during core client start up.

--gui_rpc_port N
Specify port for GUI RPCs

See http://boinc.berkeley.edu/wiki/Cc_config.xml for configuring the execution command.

A) Do not know if this is a different port to what 31416 is used [have never experimented with it]
B) Just wondering, if you wish to SSH tunnel BOINC specifically, why not use 31416 BOINC default? [Just don't know if this would cause issue... test to proof case].
[Sep 17, 2012 8:44:47 AM]   Link   Report threatening or abusive post: please login first  Go to top 
a_mobile_humanist
Cruncher
Joined: May 20, 2011
Post Count: 34
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Connecting BOINC Manager thru an SSH tunnel

A port over which *GUI* RPC is send can be specified during core client start up.

--gui_rpc_port N
Specify port for GUI RPCs

See http://boinc.berkeley.edu/wiki/Cc_config.xml for configuring the execution command.


I've seen this option before and didn't have any luck, but thanks for the link to the config file info. This looks useful; I'll give it a read and try again.


B) Just wondering, if you wish to SSH tunnel BOINC specifically, why not use 31416 BOINC default? [Just don't know if this would cause issue... test to proof case].


Because I have boinc clients running on all my machines, including the "control" machine where I run BOINC Manager. Reassigning 31416 to an SSH tunnel would mess up the instance of BOINC Manager controlling the local machine. The assignment of an arbitrary and high port number when establishing the tunnel is meant to avoid this.
[Sep 17, 2012 5:24:49 PM]   Link   Report threatening or abusive post: please login first  Go to top 
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
Re: Connecting BOINC Manager thru an SSH tunnel

Others have been using alternate ports before to facilitate the loading and connecting of multiple BOINC Managers on one host, but each connected to a different client. The simplest was to increment from the standard port to 31417, 31418 etc and not run risk of low port conflicts.

On the BOINC forum found a past topic on SSH tunneling, so it's not like it was not researched before. Here's one: http://boinc.berkeley.edu/dev/forum_thread.php?id=7421 where the developer answer was he did not know how. There's also this: http://www.boinc-wiki.info/Controlling_the_BOINC_Daemon_via_SSH but applying to Linux.

And this google hit, does mention the :xxxx port method which you already tried: http://www.unitedboinc.com/en/boinc-info/56-i...inc-manager-advanced-view It mentions the use of... --gui_rpc_port N so there;s your solution, to get that working.
[Sep 17, 2012 5:50:11 PM]   Link   Report threatening or abusive post: please login first  Go to top 
a_mobile_humanist
Cruncher
Joined: May 20, 2011
Post Count: 34
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Connecting BOINC Manager thru an SSH tunnel [RESOLVED]

Normally, I wouldn't bump my own old dead thread, but I've found a solution to my problem, which I'll describe here in case someone happens along later with a similar question/search.

As in my original post, I was attempting to establish an SSH tunnel as follows:

ssh -D 4242 myuser@192.168.1.101

The -D option is used to set up dynamic port-forwarding over the SSH connection. I thought this mean that SSH would accept any arbitrary traffic at local port 4242, push it across the SSH connection, and then send it along as normal. Instead, the SOCKS proxy server established by this option will not accept arbitrary traffic. It will accept only SOCKS traffic; the application attempting to connect to port 4242 must be able to speak SOCKS. BOINC manager gui rpc does not speak SOCKS -- the SOCKS configuration present in BOINC Manager is for use in accessing project servers across the internet [as when you manually request a project update], but apparently has no effect on the connection used for gui rpc. SOCKS support for gui rpc would be a nice feature to have in a future version of the Manager...

Anyway, the SSH command I should have used turns out to be:

ssh -f -L 4242:127.0.0.1:31416 myuser@192.168.1.101 sleep 120

This command allows for the forwarding of any traffic from a local port (4242) to the specified address and port at the other end of the SSH connection, on the BOINC client (127.0.0.1:31416). This command also tells SSH to run in the background (-f) and wait 120 seconds for an application to connect for port forwarding (sleep 120) before deciding that no traffic is coming and disconnecting. Thus, BOINC Manager can be told to connect to the computer at 127.0.0.1:4242, and it quite happily connects straight through the SSH tunnel and to the BOINC client running at 192.168.1.101.

remote_hosts.cfg must still be configured to allow connections from the remote machine's IP address (as the connection exiting the SSH tunnel will still appear to originate from that machine), but the default BOINC rpc port (31416) no longer needs to be open to any external network interfaces. Such is the whole point of the exercise, after all.

Now my BOINC machines need only have the one port open to a secure service (SSH port 22) instead of a whole mess of others. My portscan reports are much happier with the state of things now. nerd biggrin The only downside (so far) is that now all of the instances of BOINC Manager sitting here on my desktop claim to be connected to to 127.0.0.1, making it difficult to tell which of my BOINC clients is which. Again, proper native support for SOCKS/SSH at the gui rpc end of things might be able to fix this.
----------------------------------------
[Edit 4 times, last edit by a_mobile_humanist at Sep 26, 2012 8:03:01 AM]
[Sep 26, 2012 7:45:23 AM]   Link   Report threatening or abusive post: please login first  Go to top 
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
Re: Connecting BOINC Manager thru an SSH tunnel [RESOLVED]

That's a nice solution for the *very* secure conscious. Re "the whole mess of others", yes, BOINC uses a random port I/O port in addition to 31416. Long ago experimented with that when configuring a firewall and get the traffic through. This may in fact be the pointer solution I needed when setting up the UFW/GFW on Ubuntu... always was able to connect to other clients from there to Windows machines, but never into the Linux machine even opening up specific ports to specific applications... so used TeamViewer7, to make it convoluted and complicated. Could not get BOINCTasks to connect with UFW/GFW on, regardless of LAN IP/ports permissions set.

Thank you for sharing and duly bookmarked in the How To folder.

edit: P.S. Could you also please insert [RESOLVED] in the OP title. This tells the case was completed, successfully, to anyone seeing the thread header.
----------------------------------------
[Edit 2 times, last edit by Former Member at Sep 26, 2012 8:17:10 AM]
[Sep 26, 2012 8:14:57 AM]   Link   Report threatening or abusive post: please login first  Go to top 
a_mobile_humanist
Cruncher
Joined: May 20, 2011
Post Count: 34
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: Connecting BOINC Manager thru an SSH tunnel [RESOLVED]

Re "the whole mess of others", ...


I was actually being unclear here. The mess isn't BOINC's, but rather my own. My set up includes other programs/services that I use in conjunction with BOINC, such as apcupsd (http://www.apcupsd.org/) which can gracefully shutdown my machines in the event of a power outage. The apcupsd software isn't SOCKS aware either; now that I know how to run it over SSH, its ports need not be open either.


That's a nice solution for the *very* secure conscious.


Or for those of us sharing a local network with other Windows users who often need us to clean out their malware infections. d oh This Windows user prefers preventative to palliative care.
----------------------------------------
[Edit 1 times, last edit by a_mobile_humanist at Sep 26, 2012 8:28:25 AM]
[Sep 26, 2012 8:27:21 AM]   Link   Report threatening or abusive post: please login first  Go to top 
Posts: 11   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread