Authentication failed in WinScp SFTP

10,913

Solution 1

Open WinSCP--> go to Session window fill the details with Host name Username and password Now click on Edit button then it will highlight the Advanced button. Now click on that select SSH--> Authentication left side select the path of Private key file that's it. your problem will solve.

Solution 2

Make sure you have added the correct .ppk file for authentication.
Also the username used should be correct (case sensitive), You can try with

"sftpInboundAgent"

or similar. You will need to enable logging before login to see the logs. The location for log file can be modified as per needs there.

Share:
10,913
gihan-maduranga
Author by

gihan-maduranga

Updated on June 04, 2022

Comments

  • gihan-maduranga
    gihan-maduranga almost 2 years

    I am trying to connect to my partner company server using WinSCP to upload some files into their server.I tested with username and password authentication and its works fine.To establish a connection between my partner company server and WinSCP i created two pub/private key pair using Putty and gave my pub key to server and i add my private key on WinSCP authentication.The server handle incoming request through Agent user.As a user name in WinSCP i gave that agent username.But when i try to connect i got following error.

    Authentication log (see session log for details):
    Using username "SftpInboundAgent".
    Server refused our key.
    
    Authentication failed.
    

    Also i am new to WinSCP. So i can not find my log file location.I would like to know that how can i overcome above mentioned problem.

  • gihan-maduranga
    gihan-maduranga almost 9 years
    i found log file and also recreated keys and tried but still got same problem.Thanks.
  • Ankur Kumawat
    Ankur Kumawat almost 9 years
    WinSCP gives the message when username is not correct. and I think the problem is with the username, it is case-sensitive. You should try with different cases (all lower).
  • Ankur Kumawat
    Ankur Kumawat almost 9 years
    The issue is that, I can tell that much. Rest is up to you. Check the username provided. If that is correct ask the person responsible for username and verify it with him. If you are using amazon instance. Username can be seen on the management page.
  • gihan-maduranga
    gihan-maduranga almost 9 years
    Appreciate your help but there is nothing wrong with my username.i checked.it seems like problem with my pub/private key format.
  • Ankur Kumawat
    Ankur Kumawat almost 9 years
    Then there should not be any issue related to the key..assuming you are entering the correct password and using a .ppk file for authentication
  • rishi
    rishi over 3 years
    Thank you for this, I've been struggling