[[:tux|{{ :linux.png?40|}}]] ===== scp: Syntax und Beispiele ===== Wenn SSH auf Ziel- und Quellmaschine installiert ist, können über scp ((http://unixhelp.ed.ac.uk/CGI/man-cgi?scp+1)) Dateien über das Terminal verschoben werden. Die Syntax hierzu wird an einigen Beispielen erklärt: Copy the file >>foobar.txt<< from a remote host directory to the local host: $ scp your_username@remotehost.edu:/some/remote/directory/foobar.txt /some/local/directory Copy the file >>foo bar.txt<< from a remote host directory to the local host. Please note the space in the filename: $ scp your_username@remotehost.edu:'/some/remote/directory/foo\ bar.txt' /some/local/directory Copy the file >>foobar.txt<< from the local host to a remote host: $ scp /path/to/local/directory/foobar.txt your_username@remotehost.edu:/some/remote/directory Copy the directory >>foo<< from the local host to a remote host's directory >>bar<<: $ scp -r foo your_username@remotehost.edu:/some/remote/directory/bar Copy the file >>foobar.txt<< from remote host >>rh1.edu<< to remote host >>rh2.edu<<: $ scp your_username@rh1.edu:/some/remote/directory/foobar.txt your_username@rh2.edu:/some/remote/directory/ Copy the files >>foo.txt<< and >>bar.txt<< from the local host to your home directory on the remote host: $ scp foo.txt bar.txt your_username@remotehost.edu:~ Copy multiple files from the remote host to your current directory on the local host: $ scp your_username@remotehost.edu:/some/remote/directory/\{a,b,c\} . $ scp your_username@remotehost.edu:~/\{foo.txt,bar.txt\} . **scp Performance** Der Default Encryption Algorythmus bei SSH ist Triple-DES. Bei Verwendung der Blowfish Encryption (-c blowfish) kann die Performance uU gesteigert werden. Beide Stationen müssen dazu die Blowfish Encryption unterstützen. Copy the file >>foobar.txt<< from localhost to remote users home directory by using the blowfish cypher: $ scp -c blowfish foobar.txt your_username@remotehost.edu:~ Ebenfalls kann es die Performance positiv beeinflussen, wenn man die Kompression (- C) eingeschaltet. Diese Option kann den Durchsatz bei langsamen Verbindungen (WAN etc) erheblich steigern, bei schnellen Netzwerken (LAN etc) jedoch wird sich der Durchsatz nicht signifikant erhöhen. Copy the file >>foobar.txt<< from localhost to remote users home directory by using the blowfish cypher and compressed data transfer: $ scp -c blowfish -C foobar.txt your_username@remotehost.edu:~ --- //pronto 2010/03/29 20:04// {{keywords>linux unix osx syntax beispiele secure copy ssh}}