Skip to content

Instantly share code, notes, and snippets.

@git-bhanu
Created November 30, 2021 09:28
Show Gist options
  • Save git-bhanu/0e004724473ac7ed1d9ac57b8f7ed546 to your computer and use it in GitHub Desktop.
Save git-bhanu/0e004724473ac7ed1d9ac57b8f7ed546 to your computer and use it in GitHub Desktop.
When setting up openlitespeed on AWS and trying to scp you can get `.ppk are too open` issue. This gist is a document which would help you fix that.

Fix .ppk are too open when running the command from your windows WSL

(This may work on windows CMD terminal as well.)

Quick fix command that needs to be used.

sudo scp -i /mnt/d/PuttyKey/live_open_ssh -r /mnt/d/ixi\ backup/November_29_acf8a2576fd1cce99287_20211129171850_archive.zip ubuntu@ec2-1-111-11-111.us-east-X.compute.amazonaws.com:/var/www/html

When you will run this you may get

scp: /var/www/html/November_29_acf8a2576fd1cce99287_20211129171850_archive.zip: Permission denied

To fix this login into your ec2 instance and run the following command

sudo chown -R ubuntu:ubuntu /var/www/html
sudo chmod -R 755 /var/www/html

Fixing permissions for your instance. https://docs.litespeedtech.com/cloud/images/wordpress/#uploading-files

sudo chown -R www-data:www-data /var/www/html
sudo find /var/www/html -type d -exec chmod 0755 {} \;
sudo find /var/www/html -type f -exec chmod 0644 {} \;
@git-bhanu
Copy link
Author

If you are still getting issues like permission are too open with your ssh key. Do this.

Solution

I had a similar issue but I was at work and don't have the ability to change file permissions on my work computer. What you need to do is install WSL then copy the your key to the hidden ssh directory in WSL:

cp <path to your key> ~/.ssh/<name of your key>

Now you should be able to modify the permissions normally.

sudo chmod 600 ~/.ssh/<your key's name>

Then ssh using WSL:

ssh -i ~/.ssh/<name of your key> <username>@<ip address>

Credit => https://superuser.com/a/1479763

@git-bhanu
Copy link
Author

OpenLiteSpeed Change PHP version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment