en:navody:sftp:start

SFTP

In Linux you can use command-line program called sftp to copy data between a local station and server. Program sftp behaves like command-line ftp-client but with the difference that it use ssh protocol for encryption data transfer.

To connect to the server you can use following command:

sftp user@server
IPv4 addresses of access servers (hosts) for each data center are:

Ostrava ssh.du4.cesnet.cz
Jihlava ssh.du5.cesnet.cz

IPv6 addresses of access servers (hosts) for each data center are:

Ostrava ssh6.du4.cesnet.cz

Services using IPv6 addresses are currently in testing mode.

During the login process is very important to check if fingerprint of server is valid. To verify server please use fingerprints below. All servers in one datacenter have the same RSA, DSA and ECDSA key.

Ostrava data center (du4):

RSA, SHA256 (du4) LP7QxtJN257nb4gI8JutEwbrplx+MwdrwBtkhovQl+U
ECDSA, SHA256 (du4) 9YvWE2h459dMcLWcLcD1DsrxTjqqMLD16eiSYXBVX9k
ECDSA, MD5 (du4) 23:f8:17:39:9e:18:4e:dc:bb:4a:b6:04:1c:f5:74:de

Jihlava data center (du5):

RSA, MD5 (du5) 4f:b3:b2:31:aa:30:f1:6f:bc:58:4f:2d:39:e7:85:26
RSA, SHA256 (du5) lIJzpmmnnCQReVAaVom/jkZ1hUNWe/4nnbAl58liJbI
ECDSA, MD5 (du5) d1:72:10:45:5b:3b:ac:c6:ae:e8:32:3b:1c:c3:3e:69
ECDSA, SHA256 (du5) YB7YnmuMktwsFxVe5qdzy2bLU9y+0yowEcpZp82P4nk

If the key does not match, stop connecting to the server and contact us at: support@cesnet.cz

After you confirm the command, it will display prompt for a password. List of available commands can be listed byt sending a command

?

or

help

Command “ls” - will list current directory on the server.

sftp> ls
aaa                                  vsftpd-2.3.5-1.0.0.x86_64.rpm

Command “put soubor” - copies the file from the local system to sftp-server

sftp> put /tmp/vsftpd-2.3.5-1.0.0.x86_64.rpm
Uploading /tmp/vsftpd-2.3.5-1.0.0.x86_64.rpm to /VO_storage/home/uzivatel/vsftpd-2.3.5-1.0.0.x86_64.rpm
/tmp/vsftpd-2.3.5-1.0.0.x86_64.rpm                                                                                   100%  246KB 123.0KB/s   00:02    

Command get without a parameter copies the file to the working directory.

sftp> get vsftpd-2.3.5-1.0.0.x86_64.rpm
Fetching /VO_storage/home/uzivatel/vsftpd-2.3.5-1.0.0.x86_64.rpm to vsftpd-2.3.5-1.0.0.x86_64.rpm
/VO_storage/home/kopecky/vsftpd-2.3.5-1.0.0.x86_64.rpm                                                               100%  246KB 246.1KB/s   00:01    

You can also specify location where the file will be stored.

sftp> get vsftpd-2.3.5-1.0.0.x86_64.rpm /tmp/
Fetching /VO_storage/home/uzivatel/vsftpd-2.3.5-1.0.0.x86_64.rpm to /tmp/vsftpd-2.3.5-1.0.0.x86_64.rpm
/VO_storage/home/uzivatel/vsftpd-2.3.5-1.0.0.x86_64.rpm                                                               100%  246KB 246.1KB/s   00:00    

When you are working with the directory you must add the parameter “-r”.

sftp> get -r aaa /tmp/
Fetching /VO_storage/home/uzivatel/aaa/ to /tmp/aaa
Retrieving /VO_storage/home/uzivatel/aaa

User is login username and server is the name of the server on which that user has data storage - the information was handover to user in the registration data storage.

Last modified: 22.02.2017 14:34