The most basic way to start an SFTP session in the command line is via:
sudo sftp server.hostname.com
Note: I am including sudo
in these examples because at least in my experience, you usually need to prepend it in professional environments in order to run commands with the security privilege of root. It also helps me copy and paste it as is to the command line.
If you have a specific user account, use:
sudo sftp [email protected]
If you want to authenticate an SFTP session with a private key, use:
sudo sftp -o IdentityFile=~/path/to/privatekey.pem [email protected]
View the manual for SFTP by typing:
man sftp