Sponsored Content
Top Forums Shell Programming and Scripting how to use SCP (secure copy) in UNIX Post 45080 by malcom on Monday 15th of December 2003 04:37:06 AM
Old 12-15-2003
syntax error

Hi,

you are using the wrong syntax of scp, the first option is the source and the last one is the destination.

So, please try in your script

sourceserverA> scp -P <port> <sourcefile path> userid@serverBhostname:/put/this/here

Regards
Malcom
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

looking for a secure copy program (scp)

Hi could someone tell me where to find a secure copy prog. for unix and windows thnx a lot helios (4 Replies)
Discussion started by: helios
4 Replies

2. UNIX for Dummies Questions & Answers

SCP - Secure copy with Certificates exchange.

Will an scp command always copy the files in an encrypted mode? After trying this, I have got message Host Key not found in the database. & Unable to write host key in my user directory. Please anyone has an idea, how we can have secure copy with certificates exchanged successfully? (0 Replies)
Discussion started by: videsh77
0 Replies

3. Solaris

Secure method - get files - no ssh/scp

I have two servers. server 1 - secure server running ssh only on solaris 9. I can installed whatever I need here as long as its reasonably secure server 2 - running telnet (no ssh/scp installed) - I cannot change much on this server and cannot install much.. I need to pull some files from... (3 Replies)
Discussion started by: frustrated1
3 Replies

4. UNIX for Dummies Questions & Answers

SCP -r from Secure FTP site

Hi all, My problem is simple. I would like to download the contents of a directory on an ftp site. I can access the site through windows, but there are many files and it would be too tedious to click and download each file. Thus, I am trying to use scp -r... (5 Replies)
Discussion started by: cpabrego
5 Replies

5. Shell Programming and Scripting

SCP copy

I want to copy all the files and subdirectory from a server. I tried scp pritish@ipaddress:/home/pritish -r $PWD it copies all the files but not the directory, Can any one help me. I want to copy files as well as subdirectory from a server directory Note: Use CODE-tags when... (2 Replies)
Discussion started by: pritish.sas
2 Replies

6. UNIX for Dummies Questions & Answers

Secure copy help

I want to use scp in a script and have two questions: 1. Is there a way to use password in script, so script does not halt and ask for my password for remote box half way through? 2. The code below copies the file to my home directory on the remote server. How can I copy "file" to the same... (3 Replies)
Discussion started by: chrisjones
3 Replies

7. Shell Programming and Scripting

Help with Secure Copy (SCP) command

Hi, I am in the process of converting ftp transfres to SCP in my scripts. Have some doubts with SCP command 1) currently script puts a list of ftp commands in afile and paasses the file to ftp as input echo "user abc pwd" >inputfile echo "ls *" >> inputfile echo "quit" >> inputfile... (5 Replies)
Discussion started by: justchill
5 Replies

8. UNIX for Dummies Questions & Answers

directory copy with scp

I need to copy all files and directories with scp, but seems I am missing something? /usr/bin/scp -p /custscripts/* rmprod2:/custscripts doesn't copy directories and files under them. Please advise. (1 Reply)
Discussion started by: Daniel Gate
1 Replies

9. UNIX for Advanced & Expert Users

Secure Copy, scp

Is there a way we can avoid asking of password when we transfer file from one Unix server to another server using SCP command. Or Is is possible that the batch file in unix in which I am giving the SCP command takes the password and transfer the files automatically without me typing the... (1 Reply)
Discussion started by: Pash
1 Replies

10. UNIX for Advanced & Expert Users

Secure Copy - File Transfer between 2 server

Using RCP command we can transfer file from one server to another server. While transferring we can rename the file also e.g. File name = FILE123.txt (lying on Source server = oldserver) Target Server Name = newyour Renamed File = FILE456.txt rcp FILE123.txt newyour:./FILE456.txt... (1 Reply)
Discussion started by: Pash
1 Replies
SCP(1)							    BSD General Commands Manual 						    SCP(1)

NAME
scp -- secure copy (remote file copy program) SYNOPSIS
scp [-pqrvBC46] [-F ssh_config] [-S program] [-P port] [-c cipher] [-i identity_file] [-o ssh_option] [[user@]host1:]file1 [...] [[user@]host2:]file2 DESCRIPTION
scp copies files between hosts on a network. It uses ssh(1) for data transfer, and uses the same authentication and provides the same secu- rity as ssh(1). Unlike rcp(1), scp will ask for passwords or passphrases if they are needed for authentication. Any file name may contain a host and user specification to indicate that the file is to be copied to/from that host. Copies between two remote hosts are permitted. The options are as follows: -c cipher Selects the cipher to use for encrypting the data transfer. This option is directly passed to ssh(1). -i identity_file Selects the file from which the identity (private key) for RSA authentication is read. This option is directly passed to ssh(1). -p Preserves modification times, access times, and modes from the original file. -r Recursively copy entire directories. -v Verbose mode. Causes scp and ssh(1) to print debugging messages about their progress. This is helpful in debugging connection, authentication, and configuration problems. -B Selects batch mode (prevents asking for passwords or passphrases). -q Disables the progress meter. -C Compression enable. Passes the -C flag to ssh(1) to enable compression. -F ssh_config Specifies an alternative per-user configuration file for ssh. This option is directly passed to ssh(1). -P port Specifies the port to connect to on the remote host. Note that this option is written with a capital 'P', because -p is already reserved for preserving the times and modes of the file in rcp(1). -S program Name of program to use for the encrypted connection. The program must understand ssh(1) options. -o ssh_option Can be used to pass options to ssh in the format used in ssh_config(5). This is useful for specifying options for which there is no separate scp command-line flag. For example, forcing the use of protocol version 1 is specified using scp -oProtocol=1. -4 Forces scp to use IPv4 addresses only. -6 Forces scp to use IPv6 addresses only. DIAGNOSTICS
scp exits with 0 on success or >0 if an error occurred. AUTHORS
Timo Rinne <tri@iki.fi> and Tatu Ylonen <ylo@cs.hut.fi> HISTORY
scp is based on the rcp(1) program in BSD source code from the Regents of the University of California. SEE ALSO
rcp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), ssh_config(5), sshd(8) BSD
September 25, 1999 BSD
All times are GMT -4. The time now is 09:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy