Operating System - HP-UX
1830940 Members
1724 Online
110017 Solutions
New Discussion

Re: how is different between scp and sftp?

 
natis
Frequent Contributor

how is different between scp and sftp?

how is different between scp and sftp?

I know that they are used for same purpose.

Please, suggest me.
8 REPLIES 8
A. Clay Stephenson
Acclaimed Contributor

Re: how is different between scp and sftp?

It is essentially the difference between rcp and ftp. Both can be used to transfer files. In the interactive version of sftp, the commands such as put, get, cd, ... function just as those of their ftp counterparts.

Both sftp and scp are secure and generally it's a matter of preference as to which one to use.
If it ain't broke, I can fix that.
Geoff Wild
Honored Contributor

Re: how is different between scp and sftp?

From the man pages:

scp copies files between hosts on a network. It uses ssh(1) for data
transfer, and uses the same authentication and provides the same
security as ssh(1). Unlike rcp(1), scp will ask for passwords or
passphrases if they are needed for authentication.


sftp is an interactive file transfer program, similar to ftp(1), which
performs all operations over an encrypted ssh(1) transport. It may
also use many features of ssh, such as public key authentication and
compression. sftp connects and logs into the specified host, then
enters an interactive command mode.

The second usage format will retrieve files automatically if a non-
interactive authentication method is used; otherwise it will do so
after successful interactive authentication.

The third usage format allows sftp to start in a remote directory.

The final usage format allows for automated sessions using the -b
option. In such cases, it is necessary to configure non-interactive
authentication to obviate the need to enter a password at connection
time (see sshd(8) and ssh-keygen(1) for details). The options are as
follows:


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
sreejith vp
New Member

Re: how is different between scp and sftp?

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.SCP only can use in Unix platforms,But SFTP can use all flavours
sreejith vp
New Member

Re: how is different between scp and sftp?

Dear Natis,

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.SCP only can use in Unix platforms,But SFTP can use all flavours
Steven Schweda
Honored Contributor

Re: how is different between scp and sftp?

> SCP only can use in Unix platforms,But SFTP
> can use all flavours

Not really.

alp $ scp "-V"
tcpip$ssh_scp2.exe: SSH Secure Shell OpenVMS (V5.5) 3.2.0 on COMPAQ Professional
Workstation - VMS V7.3-2
Steven E. Protter
Exalted Contributor

Re: how is different between scp and sftp?

Shalom,

Different tools for different jobs.

scp is designed for scripted transfer, sftp is more interactive. Both can be used in both contexts, but its really the intent of the designers.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Geoff Wild
Honored Contributor

Re: how is different between scp and sftp?

And here's a client you can get for Windows:

http://winscp.net/eng/index.php

There are also SFTP servers for Windows as well - so - scp and sftp run on any platform.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Ralph Grothe
Honored Contributor

Re: how is different between scp and sftp?

There's nothing special about sftp
except that it is tunneled through ssh.
In fact, you can declare your own subsystems
via the namesake directive in sshd_config
and tunnel otherwise insecure protocols that way.
This makes the usage more convenient for only occasional users of ssh, so that they are not required to set up their own tunnel via the -L (for local port forwarding), or -R (for remote port forwarding) of the ssh (client) command beforehand.
For instance, with such subsystem defined by their friendly administrator they could run a script (or complete service very much like sftp) by just issuing something like:

$ ssh -s somehost.somedom.tld tunneled_custom_cmd

with something defined on somehost's sshd_config like

Subsystem tunneled_custom_cmd /path/to/tcc_wrapper


Excerpt from man sshd_config:

Subsystem
Configures an external subsystem (e.g., file transfer daemon).
Arguments should be a subsystem name and a command to execute
upon subsystem request. The command sftp-server(8) implements
the ``sftp'' file transfer subsystem. By default no subsystems
are defined. Note that this option applies to protocol version 2
only.


Excerpt from man ssh:


-s May be used to request invocation of a subsystem on the remote
system. Subsystems are a feature of the SSH2 protocol which
facilitate the use of SSH as a secure transport for other
applications (eg. sftp(1)) . The subsystem is specified as the
remote command.

Madness, thy name is system administration