Reputation:
I am trying to set up a connection and transfer files using putty on a windows 10 platform. I have verified that the default port in putty is 22. When I run the command in the command line to connect and transfer files though I get the above error. Any idea why this is or what I should do?
Upvotes: 70
Views: 94478
Reputation: 1
I would just like to add my comment to this since I spent ~ 3hrs trying to get it working and the fix was SIMPLE....
Trying to run this would give me the address error every time:
putty -ssh 192.168.1.1 -P 22 -t -l root -i keyfile -m script.sh
After trying everything I could possible think of, one of the last attempts was rearranging the arguments and ended just being needing to move '-P' to AFTER '-t' and '-l':
putty -ssh 192.168.1.1 -t -l root -i keyfile -P 22 -m script.sh
Upvotes: 0
Reputation: 2184
I'm my case I was hitting this error because SSH was not enabled in Raspbian.
Upvotes: 0
Reputation: 1
In my case I had created a shortened "session name" in Putty -- that is, a shorter representation of the full hostname. This worked for most Putty functions -- but when I tried to use pscp I found that I needed to have a session name that was identical to the hostname.
Upvotes: 0
Reputation: 331
I had to go into the Putty Default Settings and "Save" them again, despite port 22 showing as the default. Worked for me to avoid adding the -P 22
option every time.
Upvotes: 22
Reputation: 5951
I had the same error and ended up at this page. The -P 22
did not solve my problem.
I use Putty saved sessions and double checked my command line and had the same error as the OP.
I was using:
pscp -l SESSION_NAME_IN_PUTTY ip:/remote_path local_path
I reviewed the command line options for pscp and changed the -l
to -load
and it worked.
The final command looked like:
pscp -load SESSION_NAME_IN_PUTTY ip:/remote_path local_path
Note: If you still have the error, please review your spelling of SESSION_NAME_IN_PUTTY
and ensure it is an exact match. One letter off, can cause the same error.
Upvotes: 6
Reputation: 1696
Did you try:
pscp -P 22 c:\documents\foo.txt [email protected]:/tmp/foo
Upvotes: 168