I manually use the bellow command to connect to a SFTP server. So, it asks me the password and connects to the server.
sftp -i publickey.key user@host.com