Der Linux-Befehl sftp
sftp ist ein Kommandozeilentool mit welchem eine Verbindung zu einem SFTP-Server aufgebaut werden kann. Beim SFTP (Secure File Transfer Protocol) wird die ansonsten unverschlüsselte FTP-Verbindung über einen verschlüsselten SSH-Tunnel übertragen.
Für die Benutzung des SFTP muss dies von der Gegenstelle unterstützt werden. Des Weiteren benötigen Sie einen Account auf dem entfernten SSH-Server.
Die Verbindung zum SFTP-Server wird wie folgt unter Angabe des Benutzernamens und der Adresse des SFTP-Servers aufgebaut.
[georg@centos5 ~]$ sftp georg@sftp.home.lan
Connecting to sftp.home.lan...
The authenticity of host 'sftp.home.lan (192.168.10.1)' can't be established.
RSA key fingerprint is 18:7a:36:f9:f0:a7:b4:4a:f3:4b:eb:e5:2f:4c:12:1b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'sftp.home.lan,192.168.10.1' (RSA) to the list of known hosts.
georg@sftp.home.lan's password:
Connecting to sftp.home.lan...
The authenticity of host 'sftp.home.lan (192.168.10.1)' can't be established.
RSA key fingerprint is 18:7a:36:f9:f0:a7:b4:4a:f3:4b:eb:e5:2f:4c:12:1b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'sftp.home.lan,192.168.10.1' (RSA) to the list of known hosts.
georg@sftp.home.lan's password:
Sollte der entfernte SFTP-Server nicht auf dem Port 22 lauschen, müssen Sie den Port beim Verbindungsaufbau angeben.
[georg@centos5 ~]$ sftp -oPort=22222 georg@sftp-server
Beim ersten Verbindungsaufbau zum Server wird der Fingerprint des RSA-Keys angezeigt. Bevor Sie die Korrektheit des Fingerprints bestätigen sollten Sie ihn mit dem Fingerprint des RSA-Keys am Server vergleichen. Danach werden Sie aufgefordert sich durch die Eingabe des Passworts zu authentifizieren.
Sobald die SFTP-Verbindung hergestellt wurde, wird Ihnen die folgende Kommandozeile angezeigt.
sftp>
Durch den Befehl help können Sie sich eine Liste mit den verfügbaren Befehlen anzeigen lassen.
sftp> help
Available commands:
cd path Change remote directory to 'path'
lcd path Change local directory to 'path'
chgrp grp path Change group of file 'path' to 'grp'
chmod mode path Change permissions of file 'path' to 'mode'
chown own path Change owner of file 'path' to 'own'
help Display this help text
get remote-path [local-path] Download file
lls [ls-options [path]] Display local directory listing
ln oldpath newpath Symlink remote file
lmkdir path Create local directory
lpwd Print local working directory
ls [path] Display remote directory listing
lumask umask Set local umask to 'umask'
mkdir path Create remote directory
progress Toggle display of progress meter
put local-path [remote-path] Upload file
pwd Display remote working directory
exit Quit sftp
quit Quit sftp
rename oldpath newpath Rename remote file
rmdir path Remove remote directory
rm path Delete remote file
symlink oldpath newpath Symlink remote file
version Show SFTP version
!command Execute 'command' in local shell
! Escape to local shell
? Synonym for help
Available commands:
cd path Change remote directory to 'path'
lcd path Change local directory to 'path'
chgrp grp path Change group of file 'path' to 'grp'
chmod mode path Change permissions of file 'path' to 'mode'
chown own path Change owner of file 'path' to 'own'
help Display this help text
get remote-path [local-path] Download file
lls [ls-options [path]] Display local directory listing
ln oldpath newpath Symlink remote file
lmkdir path Create local directory
lpwd Print local working directory
ls [path] Display remote directory listing
lumask umask Set local umask to 'umask'
mkdir path Create remote directory
progress Toggle display of progress meter
put local-path [remote-path] Upload file
pwd Display remote working directory
exit Quit sftp
quit Quit sftp
rename oldpath newpath Rename remote file
rmdir path Remove remote directory
rm path Delete remote file
symlink oldpath newpath Symlink remote file
version Show SFTP version
!command Execute 'command' in local shell
! Escape to local shell
? Synonym for help
Die SFTP-Verbindung kann durch die Befehle exit und quit wieder beendet werden.
sftp> quit
Dieser Eintrag wurde am 05.06.2010 erstellt und zuletzt am 16.12.2012 bearbeitet.
Direkter Link zu dieser Seite: http://www.gtkdb.de/index_7_1010.html
[ Zur Startseite ] [ Zur Kategorie ]
© 2004-2021 by Georg Kainzbauer