06-22-2006
I don't think that scp/ssh/sftp family works with a HERE doc. You would have to setup public key authentication between the two systems. You can search the site for details on how to do that. Search for public key authentication on the forums.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all.
1. How can i copy files from one unix system to another. should i use ftp? so How?
2. How can i create an archive whose extention is tar.gz? and how can i decompress them later?
3. WHat is RPM ? what does it stands for?
Thanks (5 Replies)
Discussion started by: vbs
5 Replies
2. UNIX for Dummies Questions & Answers
My oracle database is generating archive logs. I want to copy those archive logs over to backup server on a regular basis. I know how to create an ftp job and I can put it in my crontab. My problem is that I don't know how to send the files just once instead of sends all the files in the... (4 Replies)
Discussion started by: Alan Bird
4 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I'm an intern at a business that just acquired a company that ran off the unix system. They have files on this workstation that they would like to move to a windows XP pro system, but no one (myself included) has enough unix knowledge to know how to do this. It's my understanding that this can... (8 Replies)
Discussion started by: intern
8 Replies
4. Shell Programming and Scripting
Hi guys,
I need to automate scp downloads from a server to which I do not have the ability to upload my public key for automatic logins.
I know there is something called expect, but I wasn't sure if that was the best way to go. Basically I am executing a scp download command and I need the... (2 Replies)
Discussion started by: caprica13
2 Replies
5. Shell Programming and Scripting
Hi I want to transfer all files in a folder to another folder. So the files have a ending of .lop.txt
thanks (4 Replies)
Discussion started by: gisele_l
4 Replies
6. UNIX for Advanced & Expert Users
HI Experts,
I have following code to FTP all pdf files from remote (win sever) to Linux box.
function LsFiles(){
ftp -n -i -v $HT <<end_ftp
user $USR $PASSWD
cd $DIRNAME
ls "-lrt *.pdf"
bye
end_ftp
}
LsFiles > list_of_files.txt
function getFiles(){
ftp -n -i -v $HT <<end_ftp... (2 Replies)
Discussion started by: dipeshvshah
2 Replies
7. Cybersecurity
Hi,
I'm trying to set up scp but it isn't as nice as WinSCP. My requirement is to transfer a file from one machine to another with scp. This would run in a .ksh so it would need to avoid prompts (password/are you sure). First I tried this with v2: SSH with Keys HOWTO: SSH with Keys in a console... (1 Reply)
Discussion started by: Dird
1 Replies
8. Shell Programming and Scripting
Hi,
I am new to shell scripting,and i was planning to write a script that will FTP files to destination folder.
All configuration should be done through a properties files.I was planning that All configuration should be done
through a properties files. and finally the output should be... (0 Replies)
Discussion started by: rahul125
0 Replies
9. Shell Programming and Scripting
I have to write script in which I have to copy files from different directories on machine A and put them in corresponding directories in machine B.
Here machine A remains same per project and machine B keeps on changing.
Is there any way through which I can do this using single remote... (1 Reply)
Discussion started by: madhurjajoo
1 Replies
10. Shell Programming and Scripting
I need a script to automatically scp the latest files on DIR1,DIR2 and DIR3 from Source to destination server at same place(DIR1,DIR2 and DIR3) . Further details are:
Source Server (192.168.1.5)
DIR1
DIR2
DIR3
Destination Server (192.168.1.10)
DIR1
DIR2
DIR3 (7 Replies)
Discussion started by: refra
7 Replies
LEARN ABOUT CENTOS
libssh2_userauth_publickey_fromfile_ex
libssh2_userauth_publickey_fromfile(3) libssh2 manual libssh2_userauth_publickey_fromfile(3)
NAME
libssh2_userauth_publickey_fromfile - authenticate a session with a public key, read from a file
SYNOPSIS
#include <libssh2.h>
int libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session,
const char *username,
const char *publickey,
const char *privatekey,
const char *passphrase);
DESCRIPTION
session - Session instance as returned by libssh2_session_init_ex(3)
username - Pointer to user name to authenticate as.
username_len - Length of username.
publickey - Path name of the public key file. (e.g. /etc/ssh/hostkey.pub). If libssh2 is built against OpenSSL, this option can be set to
NULL.
privatekey - Path name of the private key file. (e.g. /etc/ssh/hostkey)
passphrase - Passphrase to use when decoding privatekey.
Attempt public key authentication using a PEM encoded private key file stored on disk
RETURN VALUE
Return 0 on success or negative on failure. It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a
negative number, it isn't really a failure per se.
ERRORS
LIBSSH2_ERROR_ALLOC - An internal memory allocation call failed.
LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
LIBSSH2_ERROR_SOCKET_TIMEOUT -
LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED - The username/public key combination was invalid.
LIBSSH2_ERROR_AUTHENTICATION_FAILED - Authentication using the supplied public key was not accepted.
SEE ALSO
libssh2_session_init_ex(3)
libssh2 0.15 1 Jun 2007 libssh2_userauth_publickey_fromfile(3)