Permission Denied when trying to rename wp-content/plugins folder

Posted January 22, 2021 431 views
UbuntuWordPressDigitalOceanDigitalOcean Droplets

As I was following many tutorials online for a possible solution, none has been successful.

What I have done so far:

  1. access via FTP(filezilla)
  2. locate the wp-content & plugin directory.
  3. attempted to rename : error: permission denied
  4. attempted tutorial “fixes”

    • after changing to different permission modes that was recommended, I still got the error: permission denied. and I reset the modes back to what they were originally.
  5. Extra info: I am logging in as my sudo and not my originalroot.

I am now stuck again and if anyone can direct/assist me on this matter, it is greatly appreciated!

(cannot access my admin page for wordpress because of a plugin installed. So I am trying to deactivate that plugin via ftp…)

Thank you!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

Hello, @hk1

I will recommend you to double check that the user is added to the sudoers group. As part of initial steps on the Ubuntu 20.04 server which you can check here:

As root, run this command to add your new user to the sudo group (substitute the highlighted username with your new user):

usermod -aG sudo sammy

Note : Change sammy with your actual username

Now, when logged in as your regular user, you can type sudo before commands to perform actions with superuser privileges or use with SFTP clients.


by Brian Boucheron
When you first create a new Ubuntu 20.04 server, you should perform some important configuration steps as part of the basic setup. These steps will increase the security and usability of your server, and will give you a solid foundation for subsequent actions. In this tutorial you will create a user, give them sudo access, and set up a firewall.
  • Hi Alex,

    Thank you very much for your response.

    I ran into a bigger problem before trying to attempt your solution…

    I followed this video on how to setup sudo and ssh keys…
    and I had made root changes by not allowing PermitRootLogin: – using the command:

       "vi /etc/ssh/sshd_config" 

    Timestamp : 2:30

    … I’m afraid I locked myself out of root access AS WELL as my other user I have been logging in with…
    So now I have no access to the server via terminal at all....

    Is this noob mistake irreversible?

    Thank you very much & Best Regards,

    • Hi, @hk1

      Have you tried accessing the droplet using the DigitalOcean console from your account?

      The Droplet console provides out-of-band access and is available regardless of your network settings. It emulates the access you would have if you were sitting down with a keyboard and monitor attached to the actual server. You can use this feature to log in and revert bad settings to regain normal access.

      I will recommend you to check the following article:

      How to Regain Access to Droplets using the DigitalOcean Droplet Console

      Hope that this helps!

      • Hello again,

        Sorry I have been busy settling into my classes and work etc…

        Thank you for this new information, I will remember this for future cases.

        I accessed my droplet via DigitalOcean’s console and checked for the:

        *PermitRootLogin: yes*

        it is set as yes, so I tried to login with my root and my root password in my mac terminal, but I still get the Permission Denied message…

        Not sure if this matters, but I wanted to note

        (I made the initial change from yes to no for the PermitRootLogin in my mac terminal)

        Thank you for your time and help on this matter.

        Best Regards

        • Hello, @hk1

          Can you please confirm if you’re using a password to authenticate to the droplet or you’re using a ssh-key?

          Would you mind adding the -vvv flag to your ssh command as this would make the output more verbose and it will help us to locate the actual issue?


          • I created and had set up ssh keys following a digitalocean tutorial guide, but I am logging in using a password.

            another noob thought/question: After I set up my ssh keys I was having trouble on how to use/login via the actual keys to login.. so I reverted back to using my original password.

            -vvv vi /etc/ssh/sshd_config

            Im sorry, I’m not quite sure what you mean by your comment on the -vvv?

            googling this gives no results so I am lost in what to do here.

            Sorry again for the troubles.

            Thank you,


Hi there @hk1

If you want to disable the PasswordAuthentication on the server and use your ssh-keys to login you can simply follow our existing tutorial here:

Once the ssh-key authentication is configured you can access the server via ssh just by connecting to the server using your ssh-client and not having to use PasswordAuthenticaion

Hope that this helps!

by Justin Ellingwood
by Brian Boucheron
SSH, or secure shell, is the most common way of administering remote Linux servers. Although the daemon allows password-based authentication, exposing a password-protected account to the network can open up your server to brute-force attacks. In this guide, we demonstrate how to configure your server with SSH keys, which is the recommended authentication method. These are much more difficult for attackers to work around, giving you a more secure login mechanism.
  • Hey Alex,

    Thank you for your continued responses and help..

    Before configuring my ssh authentication and disabling my PasswordAuthentication,I think I have to resolve the previous issue of not being able to login to my root, which I had locked myself out of as mentioned previously.

    I am not understanding why I am still unable to access as I had reset the settings through digitalocean’s console as you recommended to do.

    I thought that would definitely have solved the issue…
    Would you like me to add screenshots, if you are unclear of what I’m referring to exactly as I am not 100% sure if I am using the correct terminology?

    Are you able to take this into a private message or even a zoom meeting?

    – Best Regards and much appreciated