• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pscp – ssh_init: Network error: Cannot assign requested address

by admin

The PuTTY suite includes two programs for copying your files securely between machines. PSCP is a noninteractive program much like scp, and PSFTP is an interactive program inspired by ftp. You can use pscp (secure copy) and psftp (secure FTP) at the Windows XP Command Prompt. To copy a file with pscp, use:

pscp username @ host:path"

For example:

pscp file.txt geek@www.example.com:MyDocuments/.

I was playing around with pscp and encounted with an error:

ssh_init: Network error: Cannot assign requested address

1. It looks like pscp is using port 0 by default and mentioning the port allowed copying the file.

C:\temp>pscp myfie.txt oracle@10.10.10.11:/home/test/
ssh_init: Network error: Cannot assign requested address

2. So I tries to provide the port number on the command line with “-P” option:

C:\temp>pscp -P 22 myfie.txt oracle@10.10.10.11:/home/test/
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's ssh-ed25519 key fingerprint is:
ssh-ed25519 255 45:35:11:23:5d:10:e2:e3:60:6a:c9:06:bb:74:ad:34
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n) yes
oracle@10.10.10.11's password:
myfie.txt                 | 0 kB |   0.0 kB/s | ETA: 00:00:00 | 100%
C:\temp>

It worked.

Conclusion

If you are going to copy files from Linux “down” to your Windows system, you need a program that will run on Windows. The creator of PuTTY made PSCP.EXE for precisely that purpose: to implement scp for Windows.

Filed Under: Linux

Some more articles you might also be interested in …

  1. schroot Command Examples in Linux
  2. Difference between absolute and relative paths in Linux
  3. zip Command Examples in Linux
  4. How to Use the ssh-keygen Command to configure passwordless ssh
  5. cryptsetup Command Examples in Linux
  6. 14 Useful “cat” Command Examples in Linux
  7. How To Configure SNMP Daemons: snmpd and snmptrapd on CentOS/RHEL 5,6 and 7
  8. How to Configure SSH to restrict Users/Groups with allow and deny directives
  9. How to Find and Delete Empty Directories and Files in Linux
  10. Why Does a Lun World Wide ID Starts with the Number 3 in Linux dm-multipath

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright