Secure copy protocol

scp
Developer(s)The OpenSSH Project
Repositorygithub.com/openssh/openssh-portable/
Written inC
Operating systemCross-platform
TypeCommand, Communication protocol
Websitewww.openssh.com

Secure copy protocol (SCP) is a means of securely transferring computer files between a local host and a remote host or between two remote hosts. It is based on the Secure Shell (SSH) protocol.[1] "SCP" commonly refers to both the Secure Copy Protocol and the program itself.[2]

According to OpenSSH developers in April 2019, SCP is outdated, inflexible and not readily fixed; they recommend the use of more modern protocols like SFTP and rsync for file transfer.[3] As of OpenSSH version 9.0, scp client therefore uses SFTP for file transfers by default instead of the legacy SCP/RCP protocol.[4]

Secure Copy Protocol

The SCP is a network protocol, based on the BSD RCP protocol,[5] which supports file transfers between hosts on a network. SCP uses Secure Shell (SSH) for data transfer and uses the same mechanisms for authentication, thereby ensuring the authenticity and confidentiality of the data in transit. A client can send (upload) files to a server, optionally including their basic attributes (permissions, timestamps). Clients can also request files or directories from a server (download). SCP runs over TCP port 22 by default.[6] Like RCP, there is no RFC that defines the specifics of the protocol.

Function

Normally, a client initiates an SSH connection to the remote host, and requests an SCP process to be started on the remote server. The remote SCP process can operate in one of two modes:

  • source mode, which reads files (usually from disk) and sends them back to the client, or
  • sink mode, which accepts the files sent by the client and writes them (usually to disk) on the remote host.

For most SCP clients, source mode is generally triggered with the -f flag (from), while sink mode is triggered with -t (to).[2] These flags are used internally and are not documented outside the SCP source code.

Remote to remote mode

In the past, in remote-to-remote secure copy, the SCP client opens an SSH connection to the source host and requests that it, in turn, open an SCP connection to the destination. (Remote-to-remote mode did not support opening two SCP connections and using the originating client as an intermediary). SCP cannot be used to remotely copy from the source to the destination when operating in password or keyboard-interactive authentication mode, as this would reveal the destination server's authentication credentials to the source. It is, however, possible with key-based or GSSAPI methods that do not require user input.[2]

Recently, remote-to-remote mode supports routing traffic through the client which originated the transfer, even though it is a 3rd party to the transfer. This way, authorization credentials must reside only on the originating client, the 3rd party.[7]

Issues using talkative shell profiles

SCP does not expect text communicating with the SSH login shell. Text transmitted due to the SSH profile (e.g. echo "Welcome" in the .bashrc file) is interpreted as an error message, and a null line (echo "") causes SCP client to deadlock waiting for the error message to complete.[2]

scp program

The SCP program[8] is a software tool implementing the SCP protocol as a service daemon or client. It is a program to perform secure copying.

Perhaps the most widely used SCP program is the OpenSSH command line scp program, which is provided in most SSH implementations. The scp program is the secure analog of the rcp command. The scp program must be part of all SSH servers that want to provide SCP service, as scp functions as SCP server too. Since OpenSSH 9.0, the program has been updated to use the newer, more secure SFTP protocol; an -O option is added for using SCP with old SCP-only servers.[4]

Syntax

Typically, a syntax of scp program[9] is like the syntax of cp (copy):

Copying local file to a remote host:

scp LocalSourceFile user@remotehost:directory/TargetFile

Copying file from remote host and recursively copying folder (with -r switch) from remote host:

scp user@remotehost:directory/SourceFile LocalTargetFile
scp -r user@host:directory/SourceFolder LocalTargetFolder

Note that if the remote host uses a port other than the default of 22, it can be specified in the command. For example, copying a file from host:

scp -P 2222 user@host:directory/SourceFile TargetFile

Other clients

As the Secure Copy Protocol implements file transfers only, GUI SCP clients are rare, as implementing it requires additional functionality (directory listing at least). For example, WinSCP defaults to the SFTP protocol.[10] Even when operating in SCP mode, clients like WinSCP are typically not pure SCP clients, as they must use other means to implement the additional functionality (like the ls command).[11] This in turn brings platform-dependency problems.

More comprehensive tools for managing files over SSH are SFTP clients.

Security

In 2019 vulnerability CVE-2019-6111[12] was announced related to the openssh SCP tool and protocol allowing users to overwrite arbitrary files in the SCP client target directory.

See also

References

  1. ^ "Linux and Unix scp command". Computer Hope. Retrieved 4 August 2015.
  2. ^ a b c d Pechanec, Jan. "How the SCP protocol works". Jan Pechanec's weblog. Oracle. Archived from the original on 2017-02-15. Retrieved 4 August 2015.
  3. ^ "OpenSSH 8.0". OpenSSH Release Notes. 17 April 2019.
  4. ^ a b "OpenSSH 9.0". OpenSSH Release Notes. 8 April 2022.
  5. ^ "scp(1) - OpenBSD manual pages (history section)". Retrieved 25 June 2012.
  6. ^ "SCP - Secure Copy Protocol - What is it & Full Definition & Example Cmds!". PC & Network Downloads - PCWDLD.com. 2019-06-29. Retrieved 2020-05-22.
  7. ^ Carroll, Brandon (16 August 2017). "How to use Secure Copy for file transfer". TechRepublic. Retrieved 2020-05-22.
  8. ^ "Portable OpenSSH". GitHub. 13 May 2022.
  9. ^ "scp(1) - OpenBSD manual pages" https://man.openbsd.org/scp
  10. ^ "Supported File Transfer Protocols :: WinSCP". winscp.net. Retrieved 2020-05-22.
  11. ^ "The SCP/Shell Page (Advanced Site Settings dialog) :: WinSCP". winscp.net. Retrieved 2020-05-22.
  12. ^ "NVD - Cve-2019-6111".

Read other articles:

العلاقات البحرينية المولدوفية البحرين مولدوفا   البحرين   مولدوفا تعديل مصدري - تعديل   العلاقات البحرينية المولدوفية هي العلاقات الثنائية التي تجمع بين البحرين ومولدوفا.[1][2][3][4][5] مقارنة بين البلدين هذه مقارنة عامة ومرجعية للدولتين: وجه ...

 

Pour l’article ayant un titre homophone, voir Jean-Louis Tourenne. Pour les articles homonymes, voir Touraine (homonymie). Jean-Louis Touraine Jean-Louis Touraine en 2017. Fonctions Député français 20 juin 2007 – 21 juin 2022(15 ans et 1 jour) Élection 17 juin 2007 Réélection 17 juin 201218 juin 2017 Circonscription 3e du Rhône Législature XIIIe, XIVe et XVe (Cinquième République) Groupe politique SRC (2007-2016)SER (2016-2017)LREM (2017-2022) Prédécesseur Jean-Mich...

 

American college basketball season 2008–09 Memphis Tigers men's basketballC-USA Regular Season ChampionsC-USA tournament championsNCAA tournament, Sweet SixteenConferenceConference USARankingCoachesNo. 9APNo. 3Record33–4 (16–0 C-USA)Head coachJohn Calipari (9th year)Assistant coaches John Robic Orlando Antigua Josh Pastner Home arenaFedExForumSeasons← 2007–082009–10 → 2008–09 Conference USA men's basketball standings vte Conf Overall Team ...

Radio station in Ellwood, CaliforniaKSPEEllwood, CaliforniaBroadcast areaSanta Barbara County, CaliforniaFrequency94.5 MHzBrandingLa Musical 94.5 FMProgrammingFormatClassic regional MexicanOwnershipOwnerRincon Broadcasting(Rincon License Subsidiary LLC)Sister stationsKIST-FM, KOSJ, KSBL, KTMS, KTYDHistoryFirst air dateFebruary 6, 1989 (as KCQR)Former call signsKCQR (1989–1995)KSPE-FM (1995–2010)KIST-FM (2010)KFYZ (2010–2017)Technical informationFacility ID61058ClassBERP810 watts880 watt...

 

Questa voce o sezione sull'argomento canottieri non cita le fonti necessarie o quelle presenti sono insufficienti. Puoi migliorare questa voce aggiungendo citazioni da fonti attendibili secondo le linee guida sull'uso delle fonti. Renato Barbieri Nazionalità  Italia Canottaggio Società Unione canottieri livornesi Palmarès Competizione Ori Argenti Bronzi Giochi olimpici 0 1 0 Europei 1 0 0 Per maggiori dettagli vedi qui Statistiche aggiornate al 29 gennaio 2011 Modifica dati ...

 

Campeonato Sudamericano de Football 1937 Competizione Coppa America Sport Calcio Edizione 14ª Date dal 1936al 1937 Luogo  Argentina(1 città) Partecipanti 6 Impianto/i 3 stadi Risultati Vincitore Argentina(5° titolo) Secondo Brasile Terzo Uruguay Quarto Paraguay Statistiche Miglior giocatore Vicente De la Mata[1] Miglior marcatore Toro (7) Incontri disputati 16 Gol segnati 69 (4,31 per incontro) Pubblico 518 000 (32 375 per incontro) Gli argent...

Синелобый амазон Научная классификация Домен:ЭукариотыЦарство:ЖивотныеПодцарство:ЭуметазоиБез ранга:Двусторонне-симметричныеБез ранга:ВторичноротыеТип:ХордовыеПодтип:ПозвоночныеИнфратип:ЧелюстноротыеНадкласс:ЧетвероногиеКлада:АмниотыКлада:ЗавропсидыКласс:Пт�...

 

Traitor and spy in The Lord of the Rings Wormtongue redirects here. For the Icelandic poet, see Gunnlaugr Ormstunga. Fictional character GrímaTolkien characterIn-universe informationAliasesWormtongue, WormRaceMen of RohanBook(s)The Two Towers (1954) The Return of the King (1955) Unfinished Tales (1980) Gríma, called (the) Wormtongue, is a fictional character in J. R. R. Tolkien's The Lord of the Rings. He serves as a secondary antagonist there; his role is expanded in Unfinished Tales. He i...

 

American popular music vocal group This article is about the band. For other uses, see Fifth Dimension (disambiguation). This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (April 2020) (Learn how and when to remove this message) The 5th DimensionThe 5th Dimension in 1969Back row: Townson and McLemore.Front row: LaRue, Davis, and McCoo.Background informationAlso k...

طبيب عراقي يعالج طفلا. تذبذبت الحالة الصحية في العراق خلال تاريخه الحديث المضطرب. خلال التسعينات، خفض نظام صدام حسين تمويل الصحة العامة بنسبة 90 في المئة، فتدهورت الرعاية الصحية بشكل كبير.[1] وخلال تلك الفترة، ارتفعت وفيات الأمهات بمقدار ثلاثة أضعاف تقريباً، ورواتب الع�...

 

Screenshot kecil dari sebuah permainan Tower Defense Bernama GauntNet Pertahanan menara (bahasa Inggris: tower defense) merupakan subgenre dari permainan video strategi, di mana tujuannya adalah untuk mempertahankan wilayah atau barang milik pemain dari serangan musuh, yang biasanya dicapai dengan menempatkan struktur pertahanan di sepanjang jalur serangan mereka.[1] Ini biasanya berarti membangun berbagai struktur berbeda yang berfungsi untuk secara otomatis menahan, menghambat, ...

 

Election of the President of the Italian Republic 1992 Italian presidential election ← 1985 13–25 May 1992 1999 → 1,014 voters(326 Senators, 630 Deputiesand 58 regional representatives)676 (1st–3rd ballots) or 508 (4th ballot onwards) votes needed to win   Nominee Oscar Luigi Scalfaro Gianfranco Miglio Party DC Lega Nord Electoral vote 672 75 Percentage 66.3% 7.4% Result on the sixteenth ballot(25 May 1992)   Scalfaro 672   Miglio 75   Others...

United States Supreme Court nomination Amy Coney Barrett Supreme Court nominationPresident Trump with Amy Coney Barrett and her family just prior to Barrett being announced as his nominee to the Supreme Court (September 26th, 2020)NomineeAmy Coney BarrettNominated byDonald Trump (president of the United States)SucceedingRuth Bader Ginsburg (associate justice)Date nominatedSeptember 26, 2020Date confirmedOctober 26, 2020OutcomeApproved by the U.S. SenateVote of the Senate Judiciary CommitteeVo...

 

Saw

Tool used to cut through wood or other materials This article is about the cutting tool. For the 2004 horror movie, see Saw (film). For the subsequent movie franchise, see Saw (franchise). For other uses, see Saw (disambiguation). Sawblade redirects here. For the EPs, see Sawblade (Isis EP) and Sawblade (Gangrene EP). For the plant, see Dyckia brevifolia. This article's lead section may be too short to adequately summarize the key points. Please consider expanding the lead to provide an acces...

 

British band This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Bill Wyman's Rhythm Kings – news · newspapers · books · scholar · JSTOR (March 2012) (Learn how and when to remove this message) Bill Wyman's Rhythm KingsBill Wyman's Rhythm Kings Middelburg January, 2009Background informationOriginLondon, EnglandG...

Questa voce o sezione sull'argomento Lombardia non è ancora formattata secondo gli standard. Contribuisci a migliorarla secondo le convenzioni di Wikipedia. Segui i suggerimenti del progetto di riferimento. GarbogeraStato Italia Regioni Lombardia Nascea Birago nei pressi di via Gerbino 45°39′47.87″N 9°05′27.63″E45°39′47.87″N, 9°05′27.63″E Sfociaa Milano nel Cavo Redefossi 45°26′18.9″N 9°13′36.72″E45°26′18.9″N, 9°13′36.72″E Modifica dati...

 

سيغمامعلومات عامةجزء من ألفبائية يونانية اشتق من 𐤔 (en) حلَّ محل lunate sigma (en) رو تاو تعديل - تعديل مصدري - تعديل ويكي بيانات سيغما خط كبير σ صغير σ كتابة يونانية سيغما (باليونانية:σίγμα/σῖγμα) هو الحرف الثامن عشر من الأبجدية الإغريقية، وهي في نظام الترقيم اليوناني تساوي القيمة �...

 

Sporting event delegationIndia at the2008 Asian Beach GamesIOC codeINDNOCIndian Olympic Associationin BaliMedalsRanked 7th Gold 3 Silver 0 Bronze 2 Total 5 Asian Beach Games appearances20082010201220142016 India competed at the 2008 Asian Beach Games held in Bali, Indonesia from October 18, 2008 to October 26, 2008. India finished with 3 gold medals and 2 bronze medals. vteNations at the 2008 Asian Beach Games in Bali, Indonesia Afghanistan Bahrain Bangladesh Brunei Cambodia China Chinese Ta...

17th / 18th-century Caribbean privateers For other uses, see Buccaneer (disambiguation). This article may contain excessive or inappropriate references to self-published sources. Please help improve it by removing references to unreliable sources where they are used inappropriately. (January 2018) (Learn how and when to remove this message) Buccaneer of the Caribbean from Howard Pyle's Book of Pirates.[1] Buccaneers were a kind of privateer or free sailors[further explanation need...

 

1957 film by Samuel Fuller Run of the ArrowTheatrical release posterDirected bySamuel FullerWritten bySamuel FullerProduced bySamuel FullerStarringRod SteigerSara MontielBrian KeithCharles BronsonCinematographyJoseph BirocEdited byGene Fowler Jr.Music byVictor YoungProductioncompanyRKO Radio PicturesDistributed byUniversal PicturesRelease date July 25, 1957 (1957-07-25) (Premiere-Los Angeles)[1] Running time86 minutesCountryUnited StatesLanguageEnglish Run of the Ar...