4

I installed Ethereum on VPS and I have two accounts. After I installed Ethereum on my mac where I have one account. For now I'm on testnet network.

I want to connect to VSP accounts from mac terminal. I tried to do this :

geth --rpc --rpcaddr "xxx.xx.xxx.xxx" console

(xxx.xx.xxx.xxx) is the VPS IP

But when I do :

personal.listAccounts

I have just one account so I'm no connect to VSP but to my mac account .

How can I do to connect to VPS account?

  • To clarify, do you want to connect your local geth to a remote geth by rpc? – Afr Aug 30 '16 at 9:22
  • @5chdn, Yes this what I want to do. My first idea was by rpc but if there is an other way I'm buying – wxcvbn Aug 30 '16 at 9:26
  • @5chdn, Have you got an idea? – wxcvbn Aug 30 '16 at 10:20
3

Insecure approach:

On the remote machine run geth with the following arguments:

--rpc --rpcapi "admin,personal,db,eth,net,web3" --rpcport "8080"--rpcaddr "0.0.0.0"

They are detailed here, here and here.

On the local machine run:

$ geth attach rpc:http://<remote_ip>:8080

(More) Secure Approach

Connect to the VPS via SSH and run geth locally (without setting the rpcaddr argument) and connect to it through IPC:

$ geth attach ipc:/path/to/ipc

where the path is either the directory geth has been launched in or the custom --datadir passed as an argument to it.

  • Why your second solution is more secure ? – wxcvbn Aug 30 '16 at 12:11
  • 1
    You use an SSH tunnel to connect the two machines and manage the remote station meaning that only people who have credentials/certificates for that SSH connection can connect to the remote machine whereas in the first anyone knowing the network address and port of the remote geth instance can connect to it. If you have an account that's unlocked (and the eth module loaded) then someone can transfer all your balance in that account to anther they control. – Sebi Aug 30 '16 at 12:15
1

You have to enable personal via the --rpcapi switch. Here are some switch options:

--rpcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3"

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.