You can always configure passwordless ssh in order to transfer files using sftp without user being asked for a password. But if its not allowed to configure a passswordless ssh, there is a way to automate sftp file transfers. It can be achieved by using 'expect' command provided by the tcl shell. For the expect utility to work we need to install the "expect" package. To do so use the below command : # yum install expect Below is an example script that automates remote access with a batch … [Read more...] about How to automate sftp file transfers using expect utility
Archives for March 2017
How to setup passwordless SSH login in Linux
Here is a short note on configuring passwordless logins between 2 Linux systems. Process basically involves generating a public authentication key and appending it to the remote hosts ~/.ssh/authorized_keys file. Generate authentication key If an SSH authentication-key file does not exist, generate one by running the ssh-keygen command. When prompted for a passphrase, use a blank passphrase if fully password-less login is required: # ssh-keygen Generating public/private rsa key … [Read more...] about How to setup passwordless SSH login in Linux