Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Please explain this scp command

Posted on 2009-05-05
6
Medium Priority
?
302 Views
Last Modified: 2012-06-27
Can anybody please decode this for me
scp -r -i /user/home/xceldt/.ssh/id_fdt-test kstsrv5:/user/home/data/arc*$archivedate*/*.tar.gz temp
0
Comment
Question by:Umavmishra
  • 3
  • 3
6 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24303344
Hi,
-r tells scp to recursively copy entire directories.
-i tells scp which identity file (the file from which the identity (private key) for RSA authentication is read) to use.
kstsrv is the remote host
:  is the deimiter between hostname and the following -  
/user/home/data/arc*$archivedate*/*.tar.gz  ist the directory to copy from the remote host. There is a variable $archivedate contained in a directory name. This variable is set outside of scp, probably ba the script which contains the scp command.
temp is the local destination directory
wmp
 
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24303427
... let's assume $archivedate contains "2009-05-05"
scp will copy from kstsrv all files which match "*.tar.gz" from the directory or directories  matching "/usr/home/data/arc*2009-05-05*/"
The asterisks surrounding $archivedate and the asterisks contained in the filename make scp copy e.g.
/usr/home/arcABC2009-05-05DEF/UVW.tar.gz   or
 /usr/home/arcGHI2009-05-05JKL/XYZ.tar.gz  
 Replace the bold strings above with any actually existing directory/file on that host.
0
 

Author Comment

by:Umavmishra
ID: 24324118
Thanks woolmilkporc
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

Author Comment

by:Umavmishra
ID: 24324127
can you please tell me how do i give the acess details in the identity file?
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 total points
ID: 24324329
scp is based on ssh,  and one of ssh's authentication methods is 'publickey'.  This method is the one which deals with the identity file.
This method implies generating a public/private key pair.
To do so, you must run 'ssh-keygen'. During ssh-keygen you are asked for a passphrase. Leave this empty (just hit <enter>) to be able to log in with ssh (or initiate scp) without to have to enter this passphrase every time.  
The 'public' part is then given to the remote location and added there to a file named 'authorized_keys' somewhere in the home directory of the remote user (mostly ~/.ssh/authorized_keys)
The 'private' part is placed in a file at the local server, mostly in the home directory of the local user (~/.ssh/id_rsa). If this file is placed elsewhere and/or named differently, you need the -i flag of scp  to point to this 'identity file'.
HTH
wmp
 
 
 
0
 

Author Closing Comment

by:Umavmishra
ID: 31577955
Thanks a lot!
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month12 days, 18 hours left to enroll

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question