Version: latest
If you want to access SFTP from a script or if you simply prefer command line over GUI, this is the option to go with.
Nowadays sftp command is available by default in most Unix systems. If the sftp command is not available in your
system please install OpenSSH which includes an SFTP command line client.
|
First download the private key file from the SFTP view.
Then before using the login command, we first have to set correct permissions to the private key file. In-order to
set the correct permission, navigate to the directory where the downloaded private key file is stored and run the below
command. Remember to replace the <private_key_file>
part with the actual private key file name when you execute the below
command.
sudo chmod 400 <private_key_file>
Note that if you do not set correct permission to the private key file, you’ll get an error message similar fo following when you try to run the SFTP login command.
|
Now you can run the SFTP login command as follows. Please replace <private_key_file>
with the your private key file
name with path and replace <user_name> with the SFTP username (the username which was used in the form when setting up
SFTP) when executing the below command.
Note that at the first time when you run the sftp login command, you will be prompted for the private key passphrase. Please provide the password which you used in the form when setting up SFTP as the passphrase.
sftp -o Port=9193 -o IdentityFile=<private_key_file> <user_name>@sftp.as2gateway.com