5

I am new to Ethereum and tried everything to connect testnet from two local machine nodes.

I have a geth node running on a small server. I want to connect to it via geth attach from my local computer. I can’t figure out how to do it: I tried starting it will all different kinds of configs, like:

geth --rpcapi --wsapi --rpc

but when I locally do:

geth attach http://IP_ADDRESS:8545

I always just get this:

Fatal: Unable to attach to geth node - Invalid endpoint

Any idea how to start the node on the server?

2

As mentioned by BokkyPooBah above, the best approach is to use ssh. You can also simply ssh into the server running the node, and then run geth attach without having to use port forwarding. This is what I do and it works great.

I would highly recommend reading up a bit on how to securely setup ssh. For example use ssh keys to login vs. password, etc....

1

By remote server, you are meaning a server outside your private local network? Like over the Internet?

If so, your safest method is to create an ssh tunnel port forwarding between your local and remote computer. This is described in How can I expose Geth's RPC server to external connections? .

The solution above is best for temporary connections between your local and remote computers, not for long term permanent connections as this connection does drop out periodically.

You would not want to expose geth port 8545 communication over an insecure connection as your passwords will be sent in cleartext.

More information of your situation / requirements would be helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.