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?

wxcvbn
  • 827
  • 1
  • 7
  • 17

2 Answers2

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.

Sebi
  • 5,294
  • 6
  • 27
  • 52
  • 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"

Roland Kofler
  • 11,638
  • 3
  • 44
  • 83