03-20-2017
By design, SFTP should prevent you from easily shovelling in credentials.
- If you want to have a manually driven connection, you can always let it prompt to the screen for the password (you can code the user in the sftp such as sftp remote_user@remote_host)
- If you want to fully automate the connection, keys are the way to go. Is there a reason that you don't want to use keys?
Robin
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Guys
How can I use sftp through a shell script? OR is there is a more secure way to transfer files from one host to another (in a non-secure environment)?
Please help. I have tried various options. And I am currently doing the transfer of backups manually, I want to automate this.
... (1 Reply)
Discussion started by: skotapal
1 Replies
2. UNIX for Dummies Questions & Answers
I have this script but it is not working I need help, to transmit a file and rename it.
#!/bin/ksh
final_file="file name"
ftp -nvd IP_address << ENDFTP
user username password
cd <folder where you want to put the file>
bin
mput $final_file
quit
ENDFTP (0 Replies)
Discussion started by: HROMERO
0 Replies
3. Shell Programming and Scripting
I am new to the forum. I need help with writing a unix sftp script that will allow me to put a txt file in the destination server. The destination server is a windows box and when I connect from another windows machine, at the dos prompt I need to
Type: ftp<sp> ftp-gw<enter>
Type: servername... (2 Replies)
Discussion started by: coburn
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I want download files from Server A to Server B when i want run script.
my source server : A
my Destination server:B
I have to run script in server A only.
please help me on this. (2 Replies)
Discussion started by: koti_rama
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I need a script that automatically connect to a sftp server and send a file. The problem I have is that it need to enter the password. As you might enter the password automatically so it would not ask.
Thank you. (7 Replies)
Discussion started by: pepeli30
7 Replies
6. Shell Programming and Scripting
Hi,
I have situation where i need to automate transferring 10000+ files using sftp.
while read line
do
if ; then
echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt
fi
done< files.txt
sftp -b sftpCommand.txt stu@192.168.2.1
The above... (1 Reply)
Discussion started by: noobrobot
1 Replies
7. Shell Programming and Scripting
Hi All,
I'm creating an sftp script that will pull data from sftp server and will also move files to a certain folder.
My question is that how will i know if the moving of files were successful, is there a way for me to determine it.
Thanks,
Reign (1 Reply)
Discussion started by: reignangel2003
1 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have a file as FILENAME.txt kept in /user/home/smalya . This txt file contains list of file names
ex : 1.txt
2. txt
3.txt
I want a shell script which will read the file name from this txt file and transfer the files into another server.
actual files (1.txt,2.txt,3.txt) are present in... (1 Reply)
Discussion started by: smalya
1 Replies
9. Shell Programming and Scripting
hi,
I have a requirement where i need to sftp the file from another server.
Let me describe in detail:
when i login into putty i use my id i.e. kusvi and then i start another acc i.e.cdram where all development works takes place...so if i am in cdram and i need to do sftp i have to exit... (1 Reply)
Discussion started by: gnnsprapa
1 Replies
10. Shell Programming and Scripting
Dear All,
I have a requirement where I have to SFTP or SCP a file in a batch script. Unfortunately, the destination server setup is such that it doesn't allow for shell command line login. So, I am not able to set up SSH keys. My source server is having issues with Expect. So, unable to use... (5 Replies)
Discussion started by: ss112233
5 Replies
LEARN ABOUT DEBIAN
libssh2_sftp_mkdir_ex
libssh2_sftp_mkdir_ex(3) libssh2 manual libssh2_sftp_mkdir_ex(3)
NAME
libssh2_sftp_mkdir_ex - create a directory on the remote file system
SYNOPSIS
#include <libssh2.h> #include <libssh2_sftp.h>
int libssh2_sftp_mkdir_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len, long mode);
int libssh2_sftp_mkdir(LIBSSH2_SFTP *sftp, const char *path, long mode);
DESCRIPTION
sftp - SFTP instance as returned by libssh2_sftp_init(3)
path - full path of the new directory to create. Note that the new directory's parents must all exist priot to making this call.
path_len - length of the full path of the new directory to create.
mode - directory creation mode (e.g. 0755).
Create a directory on the remote file system.
RETURN VALUE
Return 0 on success or negative on failure. 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_SFTP_PROTOCOL - An invalid SFTP protocol response was received on the socket, or an SFTP operation caused an errorcode to be
returned by the server.
SEE ALSO
libssh2_sftp_open_ex(3)
libssh2 0.15 1 Jun 2007 libssh2_sftp_mkdir_ex(3)