• Register
1 vote
1.3k views

Problem :

I am very new to WinSCP. If I want to SSH into my cluster then I need to go through two stages. I need to enter my password two times to reach my home directory using the SSH in my Linux terminal or the PuTTY.

But if I want to use the WinSCP recently I have started facing below error:

Trying SFTP:

Cannot initialize SFTP protocol. Is the host running a SFTP server?

How to fix above problem?

3.2k points

Please log in or register to answer this question.

1 Answer

1 vote

Solution :

I have read your problem and I have solution on your problem please go through below solution. I know this error is very misleading in some cases for beginners. I am assuming that your SSH is working properly then your error may be because of your bash is outputting some text which is breaking the SCP. If you SSH into your system there must be some text printed for example some of the welcome text. If this is your scenario then you can try to put a test in your ~/.bashrc and then you need to check if your shell is enough interactive or not. If it is not enough interactive then please do not print anything. You can use below lines of code to skip printing anything you need to put below lines of code at a very beginning of .bashrc :

#Detect if in SCP
if [ -z "$PS1" ]; then
    return
fi

Hope my solution helps you in fixing it.

5.7k points

Related questions

0 votes
1 answer 24 views
24 views
Problem: Someone help, please.Cannot initialize sftp protocol. is the host running a sftp server?
asked Jun 18 Nahil 122k points
0 votes
1 answer 174 views
174 views
Problem: The server rejected sftp connection, but it listens for ftp connections.
asked May 6 Ryan evans 1.6k points
0 votes
1 answer 2 views
2 views
Problem: Sftp file from one server to another.
asked 1 day ago Priscilla Gurpreet 71k points
0 votes
1 answer 70 views
70 views
Problem: How to access sftp server from browser?
asked Jun 5 Junia Phoebe 83.8k points
0 votes
1 answer 18 views
18 views
Problem: Someone assist me please : How to access sftp server from web browser?
asked May 31 Sawyer Parviz 166k points
0 votes
1 answer 25 views
25 views
Problem: I would like some assistance on how to check if the file exists and how to get this email if a new file was dropped and copied to the destination list.
asked Jun 2 Irenka Kiri 85.5k points
0 votes
1 answer 14 views
14 views
Problem: I'm not sure what I'm going to do with this issue : Shell script to transfer files using sftp.
asked Jun 2 Rada Gracelynn 100k points
0 votes
1 answer 23 views
23 views
Problem: I'm not sure how I got this : Ssh connect to host connection timed out.
asked Jun 4 Rada Gracelynn 100k points
0 votes
1 answer 27 views
27 views
Problem: I am running Mac OS X 10.7.4. I am unable to ssh to a remote computer, but when I do ssh user@localhost.
asked May 18 PkGuy 25.9k points
0 votes
1 answer 44 views
44 views
Problem: Any suggestions to fix this? > Ssh connect to host port 22 connection timed out linux.
asked May 15 Junia Phoebe 83.8k points