• Register
1 vote
758 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?

8 5 2
3,230 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.

8 4
5,680 points

Related questions

0 votes
1 answer 70 views
70 views
Problem : After I tried to update my Docker version to 0.8.0, I face an error message while I try to enter sudo docker version as below : Client version: 0.8.0 Go version (client): go1.2 Git commit (client): cc3a8c8 2020 ... 12:55:57 initserver: open /var/lib/docker/aufs/layers/cf2414da53f9bcfaa48bc3d58360d7f1cfd3784e4fe51fbef95197709dfc285d: no such file or directory How can I resolve the issue?
asked Jan 3, 2020 alecxe 7.5k points
0 votes
1 answer 2.6K views
2.6K views
Problem : I am trying to run startx via PuTTY and Xming but it gives following error: putty x11 proxy: unable to connect to forwarded x server: network error: connection refused
asked Nov 18, 2019 peterlaw 6.9k points
0 votes
1 answer 480 views
480 views
Problem: C:\Windows\System32\drivers\etc\protocol is an example of a file ________?
asked Mar 9, 2020 ArifulIslam 7.5k points
0 votes
1 answer 26 views
26 views
Problem: I get this message when i login with Filezilla. “Connection attempt failed with "eai_noname - neither nodename nor servname provided, or not known” Can any one guide further? My domain name is aaa.bbbb.com and cpanel ftp configuration told me that ftp server is ftp.aaa.bbb.com Looks like something related with dns resolving?
asked Jul 16, 2020 quizzBabes 160 points
0 votes
1 answer 3 views
3 views
an existing connection was forcibly closed by the remote host
asked Feb 16 ArifulIslam 7.5k points
0 votes
1 answer 133 views
133 views
Problem : I am very new to the Linux but want to set up my MySQL databases on the Amazon ec2 instance. I have followed some directions I found about resetting a user login pass by using a --skip-grant-tables option of the MySQL. Now I want to add my user ... HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement How can I turn above option off?
asked Jan 30, 2020 jwilliam 3.9k points
0 votes
1 answer 549 views
549 views
Problem : I am facing a strange MySQL error may be it is related to the database's read-only flag. The Web application that is using the MySQL is running on Debian 7.9. It was running well but suddenly started attempting to access the application powered website ... - SQLSTATE[HY000]: General error: 1290 The MySQL server is running with the --read-only option so it cannot execute this statement
asked Nov 20, 2019 peterlaw 6.9k points
0 votes
1 answer 170 views
170 views
Problem : I get mysql error help the mysql server is running with the --secure-file-priv option so it cannot execute this statement
asked Nov 7, 2019 peterlaw 6.9k points
0 votes
1 answer 161 views
161 views
Problem : I am very new to Shell scripting. Currently I am trying to write the Shell Script which should create some dirs on my remote server and then it should use the scp to copy the files from the local pc on the remote server. But whenever I try to ... Pseudo-terminal will not be allocated because stdin is not a terminal.” And my script hangs after the message. How to fix above message?
asked Feb 24, 2020 mphil 2.3k points