Open dimchrist89 opened 10 years ago
Well you don't need to be able to connect to the exchange in order to check correct operation, it's more just to check things against slightly different code once you are happy with it the test env.
That said, assume you have:
then you should be able to set up an ssh tunnel using:
ssh -L $LOCAL_PORT:$EXCHANGE_HOST:$EXCHANGE_PORT $IMPERIAL_HOST
That will open up an ssh session, but behind the scenes it will also tunnel port $EXCHANGE_PORT on the localhost to $EXCHANGE_PORT on the remote host. So in a different (local) shell, you can run:
./bitecoin_miner MyId 4 tcp-client localhost $LOCAL_PORT
However, you may find you get the error (depends on where you ssh to):
open failed: administratively prohibited: open failed
which means your ssh provider is "security conscious".
So, you can get more clever, and use netcat (nc), to get past that, as if you have stdin and stdout you can always push a socket over them.
So, you can do:
rm .backwards mkfifo .backwards REMOTE_CMD="nc $EXCHANGE_HOST $EXCHANGE_PORT"; FORWARD_CMD="ssh -v -T -x $IMPERIAL_HOST ${REMOTE_CMD}"; nc -lk $LOCAL_PORT 0<.backwards | ${FORWARD_CMD} 1>.backwards
That lets me get in via most ssh hosts. Good luck working out why it works :)
A possibly more understandable version:
rm .send .recv; mkfifo .send .recv; 0<.send \ ssh -v -T -x $IMPERIAL_HOST nc $EXCHANGE_HOST $EXCHANGE_PORT \ 1>.recv & ./bitecoin_client MyId 4 file .recv .send
You'll want passwordless authentication, which you should probably be using anyway. So you'd want to be using ssh-agent, ssh-add, and friends (or pageant under windows with putty).
A much simpler method to is to just connect to the imperial VPN. That should allow you to connect directly to any tcp socket on an internal computer.
David Thomas
On 2014-03-16 23:08, dimchrist89 wrote:
i wanted to ask if it is possible to work on our computers for cw6. You mention in the description that this can be done via ssh. Could you give us some details on that? (The problem is the limited time, since the premises of the college are open untill 12pm)
Thank you in advance,
Dimitrios Christopoulos
— Reply to this email directly or view it on GitHub https://github.com/m8pple/hpce-2013-cw6/issues/3.
i wanted to ask if it is possible to work on our computers for cw6. You mention in the description that this can be done via ssh. Could you give us some details on that? (The problem is the limited time, since the premises of the college are open untill 12pm)
Thank you in advance,
Dimitrios Christopoulos