SFTP和异地直接复制SCP

SFTP和异地直接复制SCP

作者:LAMP小白  点击:1898  发布日期:2013-04-09 21:42:00  返回列表

SFTP使用

sftpmio_gt; ls
anaconda-ks.cfg install.log install.log.syslog
sftpmio_gt; mkdir test
sftpmio_gt; ls
anaconda-ks.cfg install.log install.log.syslog test
sftpmio_gt; cd test
sftpmio_gt; ls
sftpmio_gt; ls -l
//下载
sftpmio_gt; put /etc/hosts
Uploading /etc/hosts to /root/test/hosts
/etc/hosts 100% 187 0.2KB/s 00:00
sftpmio_gt; ls
hosts
sftpmio_gt; lcd /root
Couldnmio_#39;t change local directory to mio_quot;/rootmio_quot;: Permission denied
sftpmio_gt; lcd ~
Couldnmio_#39;t change local directory to mio_quot;~mio_quot;: No such file or directory
sftpmio_gt; lcd /home/mio
sftpmio_gt; lpwd
Local working directory: /home/mio
//上传
sftpmio_gt; get hosts
Fetching /root/test/hosts to hosts
/root/test/hosts 100% 187 0.2KB/s 00:00
sftpmio_gt; lls -l
total 12
-rw-r--r-- 1 mio mio 187 Apr 10 05:38 hosts
-rwxrwxr-x 1 mio mio 40 Apr 7 05:12 mytouch.sh

SCP使用
//下载
[mio@localhost /]$ scp root@192.168.1.200:/root/test/testfile /home/mio
root@192.168.1.200mio_#39;s password:
testfile 100% 0 0.0KB/s 00:00
[mio@localhost /]$ cd ~
[mio@localhost ~]$ ll
total 12
-rw-r--r-- 1 mio mio 187 Apr 10 05:38 hosts
-rwxrwxr-x 1 mio mio 40 Apr 7 05:12 mytouch.sh
-rw-r--r-- 1 mio mio 0 Apr 10 05:46 testfile
//上传
[mio@localhost ~]$ scp /home/mio/mytouch.sh root@192.168.1.200:/root/test/
root@192.168.1.200mio_#39;s password:
mytouch.sh



上一篇:grub kernel root 下一篇:快递查询API
0