我忘了我怎么搞的了。
先占坑,以后再写吧。
sftp和ftp的区别:
FTP: 基于TCP来传输文件,明文传输用户信息和数据。
SFTP: 基于SSH来加密传输文件,可靠性高,可断点续传。
比较好用的有FileZilla这款软件。
如果想用命令行的话,可以:
sftp -P 端口号 用户名@IP地址
然后在密码不会回显的情况下,输入密码,建立连接。
ls
命令可以查看当前目录。
在sftp中下载文件:
get 文件名.后缀 下载保存地址
在sftp中上传文件:
put 文件路径 上传地址
退出sftp模式:
bye
获取全部支持的命令:
help
下表列出一些标准的sftp命令行所支持的命令:
Command | Function |
---|---|
bye | Quit SFTP |
cd | Change the directory on the remote host. |
chmod | Change the permissions of files on the remote host. |
chown | Change the owner of files on the remote host. |
exit (or quit) | Close the connection to the remote host, and exit SFTP. |
get | Copy a file from the remote host to the local computer. |
help (or ?) | Get help on the use of SFTP commands. |
lcd | Change the directory on the local computer. |
lls | List the contents of the current directory on the local computer. |
lmkdir | Create a directory on the local computer. |
ln (or symlink) | Create a symbolic link for a file on the remote host. |
lpwd | Show the present working directory on the local computer. |
ls (or dir) | List the contents of the current directory on the remote host. |
lumask | Change the local umask value. |
mkdir | Create a directory on the remote host. |
put | Copy a file from the local computer to the remote host. |
pwd | Show the present working directory on the remote host. |
rename | Rename a file on the remote host. |
rm | Delete a file on the remote host. |
rmdir | Remove a directory on the remote host (the directory usually has to be empty). |
version | Display the SFTP version. |
! | Pop out to the shell prompt to enter other commands. To return to SFTP, enter exit. If you combine ! with a command (for example, !pwd), SFTP executes the command without popping you out to the shell prompt. |
下面的截图并不完全,只是作演示用。