Do you really need SFTP? Why don't you use SCP? It is over the same protocol, SSH!
I had the same problem with FTP, the return code: $? was always 0, so I tried to map all the errors that could happen: "connection timedout", "lost connection", ... and parsed the output of the verbose execution: -vvv.
Something like:
Also, why do you need a expect script to do a SFTP? Why don't you use a passwordless ssh
Hi All,
I am trying to upload a text file from HP unix to Windows tectia server using sftp, the text file shows with new line character after upload.
For EG : abc.txt file contains
123
456
aftre upload it shows as
123 456
i am using sftp version 2.0
TQ, (4 Replies)
Hi All,
Here is my Expect script, I don't get any error message when I run it. But the file never goes to other system? I also paste the output screen below.
When I run the script, the script runs so fast. But when I do it manually, it takes about 10 minutes for the file to transfer.
... (1 Reply)
Hi Experts,
I am learning expect and wrote the below script for automatic sftp into a server:
#!/usr/local/bin/expect -f -d
spawn sftp -v test@mumux503 # logs into mumux503 as test user
expect "password:"
sleep 20
send "test\r"; # sending the password for test... (3 Replies)
How to automate sftp with out using expect script?
My batch file has the password but it is not taking. Please see below.
I want to use this sftp connection in a loop for pushing new files in a directory one at a time. Hence I can not use an expect script.
bash-2.05$... (5 Replies)
Hi Experts ,
I am new to unix programming please tell me how to write expect and hoe to call it for automated file upload process.
help me really ! (0 Replies)
Hi Experts,
Please help me to write the expect script for uploading multiple files in one shot . Below is my program that I have written.
#!/usr/local/bin/expect -f #/home/kulbhushan/sftp_prog.sh
# procedure to attempt connecting; result 0 if OK, 1 otherwise
proc connect {passw} {
expect... (1 Reply)
Hi everyone,
Something rather interesting just happened to me. I uploaded a file to a server through sftp. I closed the connection and then logged on to the server via ssh. So far so good.
When I typed ls -l in the remote server to retrieve a directory listing, the file that was previously... (2 Replies)
I have to send few gzipped files from local server to SFTP server.
My Server Info
Distributor ID: Ubuntu Description: Ubuntu 12.04.4 LTS Release: 12.04 Codename: precise
Created a bash script and could able to send files to sftp, but i want to send email if transfer is successful.
... (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)
Hi,
Below script is running on AIX 7.1 ( 7100-04-05-1720 version ) server. Recently OpenSSH version installed on server got updated from OpenSSH_6.0p1 to OpenSSH_7.5p1 version. After this update we do not receive any file upload message after put/mput command in SFTP.
sftp -b - user@server... (1 Reply)
Discussion started by: Juggernaut
1 Replies
LEARN ABOUT POSIX
sftp-server
sftp-server(1M) System Administration Commands sftp-server(1M)NAME
sftp-server - SFTP server subsystem
SYNOPSIS
/usr/lib/ssh/sftp-server
DESCRIPTION
sftp-server implements the server side of the SSH File Transfer Protocol as defined in the IETF draft-ietf-secsh-filexfer.
sftp-server is a subsystem for sshd(1M) and must not be run directly. There are no options or config settings.
To enable the sftp-server subsystem for sshd add the following to /etc/ssh/sshd_config:
Subsystem sftp /usr/lib/ssh/sftp-server
See sshd_config(4) for a description of the format and contents of that file.
There is no relationship between the protocol used by sftp-server and the FTP protocol (RFC 959) provided by in.ftpd.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
FILES
/usr/lib/sftp-server
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWsshdu |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO sftp(1), ssh(1), ssh-add(1), ssh-keygen(1), sshd(1M), sshd_config(4), attributes(5)
To view license terms, attribution, and copyright for OpenSSH, the default path is /var/sadm/pkg/SUNWsshdr/install/copyright. If the
Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed
location.
AUTHOR
Markus Friedl
SunOS 5.10 30 Jul 2003 sftp-server(1M)