Lightsail Tips

SSH Command Collection for WordPress on Amazon Lightsail

SSH Command collection of some very useful SSH commands, I have been using since a long time now you can change the names of folders with yours, or as required.

These commands are useful when you use the default WordPress on Bitnami image

Sunday 6 September 17:20
  1. Stopping your server

    sudo /opt/bitnami/ stop
  2. Starting your server

    sudo /opt/bitnami/ start
  3. Restarting your server

    sudo /opt/bitnami/ restart
  4. In case your default Server SSL Certificate is lost, or deleted by mistake or SSL giving errors :

    openssl req -newkey rsa:2048 -nodes -keyout /opt/bitnami/apache2/conf/server.key -x509 -days 365 -out /opt/bitnami/apache2/conf/server.crt
  5. Disable the bitnami Banner on WordPress New Instal

    sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1
  6. Getting Bitnami Application Password

    cat bitnami_application_password
  7. Enable support for SFTP Permissions

    sudo chown bitnami:root /opt/bitnami/apache2/conf/bitnami/bitnami.conf

    To use SFTP follow this post I have created as a Tutorial Lightsail SFTP Access With FileZilla Easily 5 Steps
  8. Delete a plugin from the WordPress directory that is causing an error, change the name with the name of the plugin folder.

    sudo rm -R apps/wordpress/htdocs/wp-content/plugins/plugin-folder
  9. Changing your directory change name with your folder names

    cd /your/directory
  10. Moving a Folder, change the name with your folder name

    sudo mv /opt/bitnami /tmp/bitnami-backup
  11. List of files in a current Directory

  12. Copying a Folder like restoring backing, Folder names should be changed by yours

    sudo cp -rf ~/backup-BACKUP_DATE/wp-content /opt/bitnami/wordpress/wp-content
  13. Finding What is running on the Port :

    sudo lsof -t -i:80 | sudo xargs ps
  14. Stopping the Process, for errors in restarting the server, change the port to 443 if required

    sudo kill -9 $(sudo lsof -t -i:80)
  15. SSH Command for Finding what SSL certificates are running

    sudo find /opt/bitnami/ -name "*.crt”


By Rahul Kharbanda

I am Rahul Kharbanda from India. I hope you like all the content I made. Welcome to comment & connect.
I am on Quora , Github , Twitter

Leave a Reply

Your email address will not be published. Required fields are marked *