Tag Info

New answers tagged


Method #1 - Using timeouts via SSHD/SFTPD If the connections are over SSH you can set these settings on the SSHD's side in the config file /etc/ssh/sshd_config. ClientAliveInterval 30 ClientAliveCountMax 5 Where these settings have the effect: ClientAliveInterval: Sets a timeout interval in seconds (30) after which if no data has been received from the ...


Redirect stderr to the file that stdout points to, then redirect stdout. That allows you to capture the error message sftpError=$( sftp $TragetUsr@$TargetserIP <<-FIL 2>&1 >> $LOGPATH/$Logfile cd $FTPDir lcd $FILEPATH put $ZipFilename bye FIL )


I think it would be better if you use passwordless authentication if you're using SFTP on a script. It is possible, I use it when SFTPing between IBM AIX boxes.


You can use ftp commands inside a shellscript in the following way: ftp -dv ${SSHHOST} >$dirFtp/$fichFtpLog <<_FINFTP_ ascii put ${dirwork}/${fichSalida} ${rutaSubida}/${fichero} close quit _FINFTP_ dirwork/fichSalida ... are shellscript vars as example. You have to note that in order to use ftp in this way, you must configure ...


Have a look at your sshd_config. You might want to set up a sftp-internal chroot. /TFTPROOT would be your chroot-dir. This is more secure than tftp. Here is a good tutorial: http://www.thegeekstuff.com/2012/03/chroot-sftp-setup/


Using the useradd command with the –d option you can add a certain user (ex: ftpuser), as well as his home directory (/homedir) like below: useradd ftpuser -d /homedir passwd ftpuser You will be prompted to enter the new password: Changing password for user <username> New UNIX password: Retype new UNIX password: passwd: all authentication tokens ...


You could use something like expect to provide the credentials each time you want to connect. It's not super secure but gives you what you want. #!/usr/local/bin/expect -- set timeout -1 spawn gvfs-mount {args} expect "User" send "joe\n" expect "Password:" send "xxxxx\n" expect eof Source: gvfs-mount specify username password

Top 50 recent answers are included