# Send a command to remote system via ssh



## ilemur (Jul 7, 2014)

I need to send a command after FreeBSD boot up to an ESXi host. The command in question is 
`esxcli storage core adapter rescan --all`

So the idea was to put it into rc.local. The problem is I currently don't have any idea how to have automatic authorization done on the remote system. Under linux and windows we have plink which can do that with. Didn't find it under FreeBSD ports. Open key authorization is also under question as the ESXi host cannot generate them.


----------



## SirDice (Jul 7, 2014)

Plink is the command line version of PuTTY. Which is basically ssh(1) for Windows. You don't need to install it. You can use the same kind of public/private key authentication. You just have to generate a key on the FreeBSD side with ssh-keygen(1) and add the public key to the server's authorized_keys file. It's exactly the same as with plink.


----------

