Introduction
Sftp is an interactive secure file transfer program. It uses ssh encryption to transfer files. ssh works on public key cryptography. Sftp uses scp (Secure CoPy) protocol to transfer the files and folder, which is secure way than other. Sftp is similar to ftp but sftp uses encrypted ssh transfer which encrypt data and command unlike ftp.
Installation
Sftp is available in openssh suite. In centos you can install openssh suite using "yum install openssh*". In Ubuntu you can install using "sudo apt-get install ssh". To access file from remote machine, remote machine should start ssh service in Centos you can start ssh service using command "service sshd start" in ubuntu "sudo /etc/init.d/ssh start".
Use
We can can use sftp by using command below
sftp user@IP_ADDRESS
Remote machine with given IP address must have running ssh service. After giving this command it will ask you to add the public key to the list of known hosts with message as shown below only for first time for given IP address.
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is 1b:4d:ee:cc:69:ef:c7:a7:ca:d0:36:25:c4:34:ef:80.
Are you sure you want to continue connecting (yes/no)?
accept it by writing yes
Now it will ask for password of remote user, give the password and you are ready to use sftp. Now you can give sftp commands to perform various operation few important commands are explained below.
sftp>cd PATH (change directory to given remote path)
sftp>ls(list directory contents present at remote)
sftp>get remote_PATH local_PATH (Retrieve (download) the remote-path and store it on the local machine.)
sftp>put local_PATH remote_PATH (Upload local-path and store it on the remote machine to the directory specified with remote_PATH.)
sftp>mkdir PATH (Create remote directory specified by path.)
sftp>rm PATH (Delete remote file specified by path.)
sftp>exit (Quit sftp)
For detail please refer man page of sftp.
Linux
what is sftp ?
what is sftp ?
Penulis : Dirman Waktu :Tuesday, October 8, 2013 0 Komentar
source just4tech
Oleh Dirman
Masukkan info detail penulis disini. Namun, jika anda tidak ingin menggunakan fitur ini, anda dapat menghapusnya melalui pengaturan HTML pada blog anda.
No comments: