Learn to set up secure SFTP access with Alby by generating a key pair, and connecting to the SFTP server with credentials.
Create .ssh
Directory
- Open a terminal and navigate to your home directory:
cd ~
- Check if the
.ssh
folder already existsls -a
- If it doesn't exists, create it:
mkdir .ssh
Generate Public Key
- Running the following command:
ssh-keygen
- In the
.ssh
folder, you will findid_rsa
(private_key) andid_rsa.pub
(public_key). - Send the contents of
id_rsa.pub
to Alby.
Send Data to SFTP
- Once Alby creates the SFTP user, you can send data.
- Alby will provide you with the username and SFTP endpoint.
- Log into SFTP from the terminal:
sftp -i ~/.ssh/id_rsa sftp_user@service_endpoint
Replace
sftp_user
with the provided username andservice_endpoint
with the provided endpoint. For example:sftp -i ~/.ssh/id_rsa alby@sftp.alby.com
- After connecting, you can send data to SFTP using the
put
command. For example:put /Users/alby/Desktop/Work/Repo/alby.json
Replace the path with the full path to the file you want to send.
These steps will help you create a public key for SFTP and send data to the SFTP server.