Welcome Guest ( Log In | Register )




Collapse

Top Submitters

· NickTheGreek (127)
·  (127)
· www.yourforum.gr (61)
· nickpar (20)
· Big (1)

Collapse

Random Tutorials

Can I recover lost text from a Microsoft Word document?

Tutorial name: Can I recover lost text from a Microsoft Word document?
Submitted by: nickpar


Collapse

Announcments


Welcome to Tutorial System!

Courtesy of www.gr8webservices.com & www.forumsandmore.com



Print this Tutorial 

Copying Files between Clients and Servers over ssh using scp

Tutorial Information
Name: Copying Files between Clients and Servers over ssh using scp
Submitter: NickTheGreek
Category: cPanel Tutorials
Submitted: 19 Mar 2011
Updated: 19 Mar 2011
Views: 241
Rating: This tutorial is unrated.
Copying Files between Clients and Servers over ssh using scp
View All Tutorials By This Member
View Discussion Topic
Description:
Linux / Unix, System Administration February 7th, 2009
Tutorial Instructions
It¢s quite common to need to upload or download file between one or more servers and the local computer.

If it¢s available a ssh access on the servers, using scp to transfer file from and to the server could be a very good option.

Here¢s its syntax:

usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2

A very simple example:

scp localfilename.txt remoteuser@www.remotehost.com:remotefilename.txt

The previous example copies localfilename.txt from the local directory to the server www.remotehost.com using remoteuser as the ssh account to authenticate on the remote server. On the remote server the transferred file will be stored as remotefilename.txt in the default login directory of remoteuser.

Copying file from and to specific directories:

scp /localdir/localfilename.txt remoteuser@www.remotehost.com:/remotedir/remotefilename.txt

Compared to the previous example, in this case, the file is taken from /localdir/localfilename.txt and stored remotely on /remotedir/remotefilename.txt.
Obviously remoteuser should have write permission on the remote directory where the file is going to be written.

In the next case, the authentication is made through a keyfile, this is the syntax:

scp -i keyfile /localdir/localfilename.txt remoteuser@www.remotehost.com:/remotedir/remotefilename.txt

In this case to login as remoteuser there will not be a prompt for password, but keyfile is used as identity file.

It¢s even possible to copy directly files from one server to another

scp firstremoteuser@www.firstserver.com:/filename.txt anotherremoteuser@www.anotherserver.com:/remotedir/remotefilename.txt

Finally one of the best features is to copy recursively directory trees to the remote server:

scp -r /localdirectory remoteuser@www.remoteserver.com:/remotedirectory

In this case, the whole content of localdirectory is recursively copied into remotedirectory. This can be very useful for moving quickly website structures.
I hope you¢ve found some useful information in this tutorial.
Comments
There have been no comments made as of yet. Why not be the first?



1 user(s) active
Active Users 1 guests, 0 members, 0 anonymous members
Sorted by Last Click
Quick Stats
Board Stats There have been a total of 244 tutorials in 6 categories and 0 sub-categories with 117126 views and 24 comments
The newest tutorial is How to Add “Move to” or “Copy to” to Windows 10¢s Context Menu by NickTheGreek

RSS Lo-Fi Version Time is now: 21st June 2025 - 03:15 AM
Skin and Graphics by Dan Ellis and Anubis. Hosting by Forums & More © 2005-2011.
InvisionGames - Your #1 Arcade Games Repository | AllSigs - Signatures for all | Rock Band + Guitar Hero = RockHero ! | The Remoters - Remote Assistance | FileMiners - You ask, We find