博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Transferring Files with SFTP or SCP
阅读量:5899 次
发布时间:2019-06-19

本文共 7804 字,大约阅读时间需要 26 分钟。

OIT Help Desk

Transferring Files with SFTP or SCP

Contents

What is SFTP or SCP?

SFTP and SCP are secure methods of transferring files between computers on a network. They are useful for sharing files with others, using data on more than one system, and downloading files for backup onto a second system. This document is intended to provide you with the basic information you need to use SFTP or SCP when working with your WAM, Glue, or OIT UNIX cluster account.

This document assumes that you are either using your WAM, Glue or OIT UNIX cluster account with SFTP client software or from a terminal window in a computer in a lab, office at the University, or at home.

The SFTP client programs and SCP command described in this document allow you to connect from a local system to a remote system in order to transfer files. The computer system on which you run the client software is referred to as the local system. The system on the other end of your file transfer session (the system running the server software) is referred as the remote system.

Conventions Used in this Document

In this document, different fonts are used to clarify the meaning of the text:

fixed indicates a computer response or a system prompt as shown on your display screen.
bold fixed indicates words or characters you type.
italic fixed is used as general word or phrase for which you must type and substitute text.
italic is used as a general word or phrase for which you must substitute text. For example, for other-machine-name you might substitute wam.umd.edu.

Note: UNIX is case-sensitive. Thus it makes a difference whether commands and file names are typed in upper or lower case.

Using SCP on the OIT UNIX System and WAM/Glue System

Secure file transfers to and from local or remote systems can be initiated with the scp UNIX command.

To use the scp command to copy files between systems, use the following command:

scp filename1 userid@hostname:filename2

where filename1 is the file on the local system that you wish to copy, userid@hostname is the userid and hostname where you wish to copy it, and filename2 is the name you want to call the file on the remote system. For example:

scp myfile jdoe@wam.umd.edu:myfile

Note: SCP may also be used to copy files from a remote system to a local system. To do this in the first example above, reverse the order of filename1 and userid@hostname:filename2.

When this command is typed on the Glue system, it will copy the file to the WAM system.

When you issue the command, you'll be prompted for the password on the remote system. You will then be given the stats of the transfer. Pay attention to the second item on the stat line; it's how much of the file got transferred (you want to see 100%). For example:

scp myfile jdoe@wam.umd.edu:myfile

jdoe@wam.umd.edu's password:
myfile 100% |***************************| 1232 00:00

The password will not show up when typed. The statistics indicate the percentage of the file that was transferred, the size of the file, and the estimated time to transfer the file (in this case, immediate). The scp command gives you three chances to get the password right before it aborts the connection.

To use the scp command to copy directories between systems, use the following command:

scp -r directoryname userid@hostname:directoryname2

where directoryname is the directory on the local system you wish to copy, userid@hostname is the userid and hostname where you wish to copy it, and directoryname2 is the name you want to call the file on the remote system. For example:

scp -r mydirectory jdoe@wam.umd.edu:mydirectory

Note: SCP may also be used to copy directories from a remote system to a local system. To do this in the first example above, reverse the order of directoryname and userid@hostname:directoryname2.

When this command is typed on the Glue system, it will copy the directory and all of its contents to the WAM system.

The most common way to display help is at a UNIX prompt. Before you issue the scp command you can receive help at the UNIX prompt. An on-line UNIX manual is available for detailed help on scp. To access the manual information about scp, type the following at the UNIX system prompt:

man scp

Using FTP on a Macintosh

Secure file transfers to and from a Mac can be initiated with client software such as Fetch 5.0.

For information about downloading Fetch 5.0, see .

To begin using Fetch 5.0 for SFTP:

  1. Double-click the Fetch icon to launch the program.
  2. A New Connection window will appear.
  3. In the Hostname: field, type in the name of the remote system you want to connect to, such as: wam.umd.edu or glue.umd.edu.
  4. In the Username: field, type in your login name for WAM or Glue.
  5. Set the Connect using: drop-down menu to SFTP.
  6. In the Password: field, type in your password for WAM or Glue.
  7. Click the Connect button.

When you have successfully connected, files on the remote system will appear in the window as shown below.

fetch5.gif

At this point, you can use the Path button to navigate through directories on the remote system. To begin downloading files from the remote system to your local system, select the file you wish to download and click the Get button. To begin uploading files to the remote system from your local system, click the Put button. Choose the file you wish to upload and click the Put button.

You can receive on-line help from within Fetch by selecting Fetch Help from the Help drop-down menu. The Help menu provides information on installing, using, and troubleshooting the program.

When you have completed your file transfer and you are ready to disconnect from the remote system, close the connection window.

Using FTP on Windows PCs

File transfers to and from a Windows PC can be initiated with client software such as F-Secure SSH File Transfer.

For information about downloading and installing F-Secure, see .

To begin using F-Secure for SFTP:

  1. Select Network Tools from Programs in the Start menu. Then, select F-Secure SSH File Transfer from the Network Tools menu. This launches the F-Secure program.
  2. Once you launch F-Secure, a window listing the contents of the local computer appears.
  3. To start a session, click the Quick Connect button. A Connect to Remote Host window will appear.
  4. In the Host name or IP address field, type the name of the remote system (such as wam.umd.edu or glue.umd.edu).
  5. In the User Name field, type in your login name for WAM or Glue.
  6. Set the Authentication Methods field to Password.
  7. Click Connect and you will be prompted for your WAM or Glue password.

fsecure.gif

Once your connection is established, the F-Secure program displays a window similar to the one above. The window is segmented into two lists. One list displays your local system's files and the other list displays the remote system's files. You can now download as well as upload files between the two systems by clicking once on the name of the file and clicking an arrow to copy the file name to the destination system.

You can receive on-line help from within F-Secure by selecting Help from the pull-down menu. The Help menu provides information on installing, using, and troubleshooting the program. Information is also available on-line at .

When you have completed your file transfer and you are ready to disconnect from the remote system, choose Disconnect from the pull-down File menu. This will disconnect you from the remote system. To quit F-Secure, choose Exit from the pull-down File menu.

Getting Further Help

For further help in using SCP or SFTP to transfer files, contact the OIT Help Desk. There are two ways you can contact this resource:

Walk-in: CSS building, room 1400, Monday-Friday, 8:00 a.m. - 5:00 p.m.
Phone: 301.405.1500, Monday - Friday, 8:00 a.m. - 5:00 p.m.

For a printable PDF version of this document, refer to .

转载于:https://www.cnblogs.com/licheng/archive/2008/03/21/1116815.html

你可能感兴趣的文章
RXjs相关
查看>>
linux基础命令 head
查看>>
objective c:import和include的区别, ""和<>区别
查看>>
spring SchedulerFactoryBean 没有创建 Scheduler的实现类bea
查看>>
基于cobbler实现自动化安装系统
查看>>
The Shared folder with you
查看>>
BodyPaint__操作步骤
查看>>
poj 2234 Matches Game
查看>>
2018年全国多校算法寒假训练营练习比赛(第五场)
查看>>
sax方式解析XML学习笔记
查看>>
Springboot配置(上)
查看>>
Luogu345: [POI2007]POW-The Flood
查看>>
java--Eclipse for mac 代码提示(代码助手,代码联想)快捷键修改
查看>>
Jdom的简单操作
查看>>
left join on/right join on/inner join on/full join on连接
查看>>
Codeforces 582B Once Again
查看>>
template.helper 多参数
查看>>
RadioButton布局图片+文字 实现tabhost效果
查看>>
[HEOI2012]采花
查看>>
access中设置不等于
查看>>