eshion / vim-sftp-sync

Automatic asynchronous SFTP,FTP,... for buffers in vim
40 stars 14 forks source link

Can I use aws pem key in vim-sftp-sync? #5

Open bartkim0426 opened 7 years ago

bartkim0426 commented 7 years ago

I'm trying to use sftp sync with my remote aws server. I have my public key in .ssh dir, so my config is

let g:vim_sftp_configs = {
\       'ticketk' : {
\       'upload_on_save'   : 1,
\       'download_on_open' : 0,
\       'confirm_downloads': 1,
\       'confirm_uploads'  : 0,
\       'local_base_path'  : '/Users/path/to/my/dir',
\       'remote_base_path' : '/home/ubuntu/',
\       'sftp_command' : 'sftp',
\       'user' : 'myusername',
\       'pass' : 'mypassword',
\       'host' : '13.124.xxx.xx',
\       'ssh_key_file': '~/path/to/my/pem_file.pem',
\   },
\}

Is it correct way to add 'ssh_key_file': '~/path/to/my/pem_file.pem', to my config or anything else? or I can't use pem key files in vim-sftp-sync? Anyway, it's really convenient and great. thx

bartkim0426 commented 7 years ago

Oh when i try to down/upload files, I got this

Press ENTER or type command to continue
spawn sftp xx.xxx.xxx.xx
Permission denied (publickey).

Connection closed
bartkim0426 commented 7 years ago

Also I can directly access to my server with pem files (chmod 400) in terminal. I think it's not a pem permission problem

keiraydev commented 5 years ago

@bartkim0426 I have same problem. but i`ve solved it.

let g:vim_sftp_configs = {
\       'ticketk' : {
\       'upload_on_save'   : 1,
\       'download_on_open' : 0,
\       'confirm_downloads': 1,
\       'confirm_uploads'  : 0,
\       'local_base_path'  : '/Users/path/to/my/dir',
\       'remote_base_path' : '/home/ubuntu/',
\       'sftp_command' : 'sftp',
\       'user' : 'myusername',
\       'host' : '-P22 -i /User/path/to/my/pem_file.pem 13.124.xxx.xx',
\   },
\}

you can try it 🗡 have a good day!