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):

ECDSA, SHA256 (du4) 9YvWE2h459dMcLWcLcD1DsrxTjqqMLD16eiSYXBVX9k 
ED25519, SHA256 (du4) L0AFWpSsuq+SFl2QBip4aFJEuG3JEnUxczomfEywYvc

Jihlava data center (du5):

ECDSA, SHA256 (du5) YB7YnmuMktwsFxVe5qdzy2bLU9y+0yowEcpZp82P4nk

If the key does not match, stop connecting to the server and contact us at: support@cesnet.cz 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.