-
Notifications
You must be signed in to change notification settings - Fork 0
The gingerjoos.com site
License
gingerjoos/gingerjoos.github.io
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="chrome=1"> <title>Dreams of thought</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="/theme/styles.css"> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" href="/theme/slicknav.css"> <script src="/theme/jquery.slicknav.min.js"></script> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> <!--[if lt IE 9]> <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script> <![endif]--> <script> $(function(){ $('#menu').slicknav({'label':''}); }); </script> <link rel="icon" href="/theme/favicon.ico" sizes="16x16 32x32 48x48 64x64" type="image/vnd.microsoft.icon"> <link rel="apple-touch-icon" sizes="114x114" href="/theme/apple-touch-icon-precomposed.png"> <link rel="apple-touch-icon" sizes="152x152" href="/theme/favicon152.png"> <link rel="apple-touch-icon" sizes="196x196" href="/theme/favicon196.png"> </head> <body> <div id="wrapper"> <header> <nav class="byline"><ul id="menu"> </ul></nav><!-- /#menu --> <div class="downloads"> <a href="#" class="fa fa-Twitter"></a> <a href="#" class="fa fa-Github"></a> </div> <hgroup> <h1>Copying files from one unix box to another with scp</h1> <footer class="article-footer"> <address class="vcard author"> By <a class="url fn" href="./author/admin.html">admin</a> </address> <abbr class="published" title="2009-07-31T11:23:00+05:30"> on 31.07.2009 </abbr> </footer><!-- /.post-info --> </hgroup> <meta name="tags" contents="Linux" /> <meta name="tags" contents="rcp" /> <meta name="tags" contents="scp" /> <meta name="tags" contents="ssh" /> <meta name="tags" contents="unix" /> <meta name="tags" contents="technology" /> </header> <section id="content" class="body article"> <div class="entry-content"> <p>ssh is a very powerful and widely used protocol in all the Unices. If you've used the ssh client in your Unix/Linux box, you must have realised how indispensable it is. There is another indispensable tool that uses the ssh protocol - scp (secure copy). scp was meant to be an alternative to unsecure tools like rcp. It has since replaced most such programs. Since scp uses the ssh protocol, the encryption it uses ensures security of your data.</p> <div class="line-block"> <div class="line">Using scp is simple. It works almost like the regular cp command. The basic syntax is</div> <div class="line-block"> <div class="line"><tt class="docutils literal">scp SOURCE DESTINATION</tt></div> <div class="line">In order to specify the SOURCE or DESTINATION we have a special syntax.</div> <div class="line"><tt class="docutils literal">USERNAME@HOST:PATH</tt></div> </div> </div> <div class="line-block"> <div class="line">Let me give you an example : <tt class="docutils literal">$scp <span class="pre">anirudh@box:/var/www/html/test.html</span> <span class="pre">gingerjoos@linux:~/test_dir/</span></tt></div> <div class="line">Copy /var/www/html/test.html in the machine called "box" as user "anirudh" to the box called "linux" as user "gingerjoos" to the path HOMEDIR/test_dir/</div> </div> <p>That's it :) Simple, right?</p> <div class="line-block"> <div class="line">To copy the file to our localmachine, we could do this</div> <div class="line"><tt class="docutils literal">$scp <span class="pre">anirudh@box:/var/www/html/test.html</span> ~/workarea/</tt></div> </div> <p>This would copy the file test.html in the machine called "box" (as user anirudh) to the localmachine at path HOMEDIR/work_area/</p> <p>Interchange the source-destination to copy file in your localmachine to the remote machine.</p> <div class="line-block"> <div class="line">If you want to copy whole directories, use the '-r' flag(recursive copy)</div> <div class="line-block"> <div class="line"><tt class="docutils literal">$scp <span class="pre">-r</span> ~/workarea/ <span class="pre">anirudh@box:~/workdir/</span></tt></div> </div> </div> <p>Since scp is tied to the ssh program, the keys you use to set up passwordless login with ssh works for scp as well.</p> <p>Got questions? Got something to add to this? Post your comments below :)</p> </div><!-- /.entry-content --> <div class="article-share-tags"> <div class="end-article-tags"> <i class="fa fa-tags"></i> <a href="./tag/linux.html">Linux</a> <a href="./tag/rcp.html">rcp</a> <a href="./tag/scp.html">scp</a> <a href="./tag/ssh.html">ssh</a> <a href="./tag/unix.html">unix</a> <a href="./tag/technology.html">technology</a> </div> <div class='article-share'> share - </div> </div> </section> <div class="neighbors"> </div> <footer> <a href="./pages/about.html" >About</a> <div class="right-footer"> <a href="./categories.html" >Categories</a> <a href="./tags.html" >Tags</a> </div> </footer> </body> </html>
About
The gingerjoos.com site
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published