/* libssh_scp.c * Sample implementation of a SCP client */ /* Copyright 2009 Aris Adamantiadis This file is part of the SSH Library You are free to copy this file, modify it in any way, consider it being public domain. This does not apply to the rest of the library though, but it is allowed to cut-and-paste working code from this file to any license of program. */ #include #include #include #include #include #include "examples_common.h" char *host; char *user; int sftp; static void usage(const char *argv0){ fprintf(stderr,"Usage : %s [options] [login@]hostname\n" "sample scp client - libssh-%s\n" "Options :\n" " -l user : log in as user\n" " -p port : connect to port\n" " -d : use DSS to verify host public key\n" " -r : use RSA to verify host public key\n", argv0, ssh_version(0)); exit(0); } static int opts(int argc, char **argv){ int i; if(strstr(argv[0],"sftp")) sftp=1; // for(i=0;i