Attempting to connect to remote server with SFTP but receiving a needless passphrase prompt

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I recently made the switch from Windows to Ubuntu for development and I have problems trying to setup a connection to a remote server.



On Windows, I use cyberduck to connect to a remote server through SFTP with an unprotected keyfile.



So now I am trying to sftp in with the command line doing this:



sudo sftp -o IdentityFile=< location of my keyfile > < myusername >@< myhostname >


And I get back this response:



Enter passphrase for key < my keyfile >: 
Permission denied (publickey).
Couldn't read packet: Connection reset by peer


I use the exact same key file to connect on Windows and it works without issue. I am never prompted to enter a passphrase because this particular keyfile does not have a passphrase and, unfortunately, I cannot replace it with a keyfile that does have a passphrase, because this was provided to me by my employer.



My keyfile's permissions are set to 600 and it is a ppk file.



What is going on here? What can I do to get connected?










share|improve this question



















  • 2




    IIRC, key format for putty/winscp/pscp is different from ssh/sftp client key format. Once you get your key(s) working, skip the SFTP and just use sshfs :)
    – ivanivan
    Oct 10 '17 at 16:55






  • 2




    See for example How to convert SSH keypairs generated using PuttyGen(Windows) into key-pairs used by ssh-agent and KeyChain(Linux) or How to convert .ppk key to OpenSSH key under Linux?
    – steeldriver
    Oct 10 '17 at 17:09










  • What does your key file look like? Show us its format.
    – Martin Prikryl
    Oct 10 '17 at 19:29










  • I believe ssh and friends (e.g. sftp) check the permission (600 as you mentioned, that's okay) and the owner of the key file as well. Since you're running it as root (via sudo), the referred file should be owned by root. It might even check the ownership of its containing directory, I'm not sure about it. (By the way, why do you use sudo at all?)
    – egmont
    Oct 10 '17 at 20:37














up vote
0
down vote

favorite












I recently made the switch from Windows to Ubuntu for development and I have problems trying to setup a connection to a remote server.



On Windows, I use cyberduck to connect to a remote server through SFTP with an unprotected keyfile.



So now I am trying to sftp in with the command line doing this:



sudo sftp -o IdentityFile=< location of my keyfile > < myusername >@< myhostname >


And I get back this response:



Enter passphrase for key < my keyfile >: 
Permission denied (publickey).
Couldn't read packet: Connection reset by peer


I use the exact same key file to connect on Windows and it works without issue. I am never prompted to enter a passphrase because this particular keyfile does not have a passphrase and, unfortunately, I cannot replace it with a keyfile that does have a passphrase, because this was provided to me by my employer.



My keyfile's permissions are set to 600 and it is a ppk file.



What is going on here? What can I do to get connected?










share|improve this question



















  • 2




    IIRC, key format for putty/winscp/pscp is different from ssh/sftp client key format. Once you get your key(s) working, skip the SFTP and just use sshfs :)
    – ivanivan
    Oct 10 '17 at 16:55






  • 2




    See for example How to convert SSH keypairs generated using PuttyGen(Windows) into key-pairs used by ssh-agent and KeyChain(Linux) or How to convert .ppk key to OpenSSH key under Linux?
    – steeldriver
    Oct 10 '17 at 17:09










  • What does your key file look like? Show us its format.
    – Martin Prikryl
    Oct 10 '17 at 19:29










  • I believe ssh and friends (e.g. sftp) check the permission (600 as you mentioned, that's okay) and the owner of the key file as well. Since you're running it as root (via sudo), the referred file should be owned by root. It might even check the ownership of its containing directory, I'm not sure about it. (By the way, why do you use sudo at all?)
    – egmont
    Oct 10 '17 at 20:37












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I recently made the switch from Windows to Ubuntu for development and I have problems trying to setup a connection to a remote server.



On Windows, I use cyberduck to connect to a remote server through SFTP with an unprotected keyfile.



So now I am trying to sftp in with the command line doing this:



sudo sftp -o IdentityFile=< location of my keyfile > < myusername >@< myhostname >


And I get back this response:



Enter passphrase for key < my keyfile >: 
Permission denied (publickey).
Couldn't read packet: Connection reset by peer


I use the exact same key file to connect on Windows and it works without issue. I am never prompted to enter a passphrase because this particular keyfile does not have a passphrase and, unfortunately, I cannot replace it with a keyfile that does have a passphrase, because this was provided to me by my employer.



My keyfile's permissions are set to 600 and it is a ppk file.



What is going on here? What can I do to get connected?










share|improve this question















I recently made the switch from Windows to Ubuntu for development and I have problems trying to setup a connection to a remote server.



On Windows, I use cyberduck to connect to a remote server through SFTP with an unprotected keyfile.



So now I am trying to sftp in with the command line doing this:



sudo sftp -o IdentityFile=< location of my keyfile > < myusername >@< myhostname >


And I get back this response:



Enter passphrase for key < my keyfile >: 
Permission denied (publickey).
Couldn't read packet: Connection reset by peer


I use the exact same key file to connect on Windows and it works without issue. I am never prompted to enter a passphrase because this particular keyfile does not have a passphrase and, unfortunately, I cannot replace it with a keyfile that does have a passphrase, because this was provided to me by my employer.



My keyfile's permissions are set to 600 and it is a ppk file.



What is going on here? What can I do to get connected?







ubuntu ssh terminal authentication sftp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 10 '17 at 18:24









Jeff Schaller

32.3k849109




32.3k849109










asked Oct 10 '17 at 16:50









Robbie Milejczak

1286




1286







  • 2




    IIRC, key format for putty/winscp/pscp is different from ssh/sftp client key format. Once you get your key(s) working, skip the SFTP and just use sshfs :)
    – ivanivan
    Oct 10 '17 at 16:55






  • 2




    See for example How to convert SSH keypairs generated using PuttyGen(Windows) into key-pairs used by ssh-agent and KeyChain(Linux) or How to convert .ppk key to OpenSSH key under Linux?
    – steeldriver
    Oct 10 '17 at 17:09










  • What does your key file look like? Show us its format.
    – Martin Prikryl
    Oct 10 '17 at 19:29










  • I believe ssh and friends (e.g. sftp) check the permission (600 as you mentioned, that's okay) and the owner of the key file as well. Since you're running it as root (via sudo), the referred file should be owned by root. It might even check the ownership of its containing directory, I'm not sure about it. (By the way, why do you use sudo at all?)
    – egmont
    Oct 10 '17 at 20:37












  • 2




    IIRC, key format for putty/winscp/pscp is different from ssh/sftp client key format. Once you get your key(s) working, skip the SFTP and just use sshfs :)
    – ivanivan
    Oct 10 '17 at 16:55






  • 2




    See for example How to convert SSH keypairs generated using PuttyGen(Windows) into key-pairs used by ssh-agent and KeyChain(Linux) or How to convert .ppk key to OpenSSH key under Linux?
    – steeldriver
    Oct 10 '17 at 17:09










  • What does your key file look like? Show us its format.
    – Martin Prikryl
    Oct 10 '17 at 19:29










  • I believe ssh and friends (e.g. sftp) check the permission (600 as you mentioned, that's okay) and the owner of the key file as well. Since you're running it as root (via sudo), the referred file should be owned by root. It might even check the ownership of its containing directory, I'm not sure about it. (By the way, why do you use sudo at all?)
    – egmont
    Oct 10 '17 at 20:37







2




2




IIRC, key format for putty/winscp/pscp is different from ssh/sftp client key format. Once you get your key(s) working, skip the SFTP and just use sshfs :)
– ivanivan
Oct 10 '17 at 16:55




IIRC, key format for putty/winscp/pscp is different from ssh/sftp client key format. Once you get your key(s) working, skip the SFTP and just use sshfs :)
– ivanivan
Oct 10 '17 at 16:55




2




2




See for example How to convert SSH keypairs generated using PuttyGen(Windows) into key-pairs used by ssh-agent and KeyChain(Linux) or How to convert .ppk key to OpenSSH key under Linux?
– steeldriver
Oct 10 '17 at 17:09




See for example How to convert SSH keypairs generated using PuttyGen(Windows) into key-pairs used by ssh-agent and KeyChain(Linux) or How to convert .ppk key to OpenSSH key under Linux?
– steeldriver
Oct 10 '17 at 17:09












What does your key file look like? Show us its format.
– Martin Prikryl
Oct 10 '17 at 19:29




What does your key file look like? Show us its format.
– Martin Prikryl
Oct 10 '17 at 19:29












I believe ssh and friends (e.g. sftp) check the permission (600 as you mentioned, that's okay) and the owner of the key file as well. Since you're running it as root (via sudo), the referred file should be owned by root. It might even check the ownership of its containing directory, I'm not sure about it. (By the way, why do you use sudo at all?)
– egmont
Oct 10 '17 at 20:37




I believe ssh and friends (e.g. sftp) check the permission (600 as you mentioned, that's okay) and the owner of the key file as well. Since you're running it as root (via sudo), the referred file should be owned by root. It might even check the ownership of its containing directory, I'm not sure about it. (By the way, why do you use sudo at all?)
– egmont
Oct 10 '17 at 20:37















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397267%2fattempting-to-connect-to-remote-server-with-sftp-but-receiving-a-needless-passph%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397267%2fattempting-to-connect-to-remote-server-with-sftp-but-receiving-a-needless-passph%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)