Lightsail add user for SSH/SFTP access

Lightsail comes with an admin account but you don’t really want to give this to third parties if they require access for support. This is how to create (and remove) additional accounts.

Refer to

First, use PuTTYGen to create key pair. The private key will be a .ppk file and the public key will be copied from the text area of the GUI into a .pub file. Save these files in a safe location.

Copy the .pub file to bitnami home directory on host.

Refer to

Use Step 2 (Option A), substitute USERNAME for the account to be created.

sudo useradd -s /bin/bash -o -u `id -u` -g `id -g` USERNAME
sudo mkdir ~USERNAME/ 
sudo cp -rp ~bitnami/.ssh ~USERNAME/
sudo cp -rp ~bitnami/.bashrc ~USERNAME/
sudo cp -rp ~bitnami/.profile ~USERNAME/
cat >> /home/USERNAME/.ssh/authorized_keys

If they need administrator access

sudo usermod -G bitnami-admins USERNAME

Then follow instructions for log in using either ssh or SFTP.

To remove user account

sudo userdel USERNAME -f

Need help? Let me take care of your IT issues.

Share this page

Scroll to Top