Dateien mit SSH / SCP Kopieren

OS : RHEL6(clone)

The following requirements must be met on both server and client:

  1. Make sure hostnames of IP addresses of both server and client are known across the network. Each hostname needs to be listed in /etc/hosts, for both server and client (see Section “ /etc/hosts ” (Chapter 21, Basic Networking, ↑Reference).)
  2. If you use a firewall, open the SSH port. Start YaST, and select Security and Users+Firewall. Go to Allowed Services and check, whether SSH is displayed as part of the list. If this is not the case, select SSH from Service to Allow and click Add. Apply your changes and leave YaST with Next and Accept.

To copy files from a server to a client, you need to know where the files are located on the server. For example, to copy a single file /srv/foo_file from the server to the current directory, use the scp command (do not forget the dot!):

scp tux@sun.example.com:/foo_file .

To copy a whole directory structure, use the recursive mode of scp:

scp -r tux@sun.example.com:/foo_directory .

If your network does not provide name resolution, use the server’s IP address directly:

scp tux@192.168.0.20:/foo_file .