I just wanted to write a simple SFTP script.
I already referred to plenty of posts before but its of no use. Please dont give me previous posts link for reference. Please comment if you are really interested in solving my issue.
1. I dont want to install SSH key
2. I dont have sshpass installed as well
3. I dont have expect installed as well.
I tried below.
Trial 1:
=====
Trial 2:
=====
I want to pass password in script somewhere and I dont want sftp session to ask password once again.
Please help...!
Last edited by vbe; 03-20-2017 at 01:35 PM..
Reason: code tags
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)
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)
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)
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)
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)
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)
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)
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)
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)
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 LINUX
sftp-server
SFTP-SERVER(8) BSD System Manager's Manual SFTP-SERVER(8)NAME
sftp-server -- SFTP server subsystem
SYNOPSIS
sftp-server [-ehR] [-f log_facility] [-l log_level] [-u umask]
DESCRIPTION
sftp-server is a program that speaks the server side of SFTP protocol to stdout and expects client requests from stdin. sftp-server is not
intended to be called directly, but from sshd(8) using the Subsystem option.
Command-line flags to sftp-server should be specified in the Subsystem declaration. See sshd_config(5) for more information.
Valid options are:
-e Causes sftp-server to print logging information to stderr instead of syslog for debugging.
-f log_facility
Specifies the facility code that is used when logging messages from sftp-server. The possible values are: DAEMON, USER, AUTH,
LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The default is AUTH.
-h Displays sftp-server usage information.
-l log_level
Specifies which messages will be logged by sftp-server. The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1,
DEBUG2, and DEBUG3. INFO and VERBOSE log transactions that sftp-server performs on behalf of the client. DEBUG and DEBUG1 are
equivalent. DEBUG2 and DEBUG3 each specify higher levels of debugging output. The default is ERROR.
-R Places this instance of sftp-server into a read-only mode. Attempts to open files for writing, as well as other operations that
change the state of the filesystem, will be denied.
-u umask
Sets an explicit umask(2) to be applied to newly-created files and directories, instead of the user's default mask.
For logging to work, sftp-server must be able to access /dev/log. Use of sftp-server in a chroot configuration therefore requires that
syslogd(8) establish a logging socket inside the chroot directory.
SEE ALSO sftp(1), ssh(1), sshd_config(5), sshd(8)
T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh-filexfer-00.txt, January 2001, work in progress material.
HISTORY
sftp-server first appeared in OpenBSD 2.8.
AUTHORS
Markus Friedl <markus@openbsd.org>
BSD January 9, 2010 BSD