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
- Stopping your server
sudo /opt/bitnami/ctlscript.sh stop
- Starting your server
sudo /opt/bitnami/ctlscript.sh start
- Restarting your server
sudo /opt/bitnami/ctlscript.sh restart
- 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
- Disable the bitnami Banner on WordPress New Instal
sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1
- Getting Bitnami Application Password
cat bitnami_application_password
- 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 - 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
- Changing your directory change name with your folder names
cd /your/directory
- Moving a Folder, change the name with your folder name
sudo mv /opt/bitnami /tmp/bitnami-backup
- List of files in a current Directory
ls
- 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
- Finding What is running on the Port :
sudo lsof -t -i:80 | sudo xargs ps
- Stopping the Process, for errors in restarting the server, change the port to 443 if required
sudo kill -9 $(sudo lsof -t -i:80)
- SSH Command for Finding what SSL certificates are running
sudo find /opt/bitnami/ -name "*.crt”