Windows Server 2012R2 - Access to folder denied for admin [closed] - permissions

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I have a folder on Windows Server 2012 that I want to delete. However, even when I try it in PowerShell or cmd.exe as admin, I'm not allowed to delete or view it. I also tried changing permissions with icals as admin, but was also denied.
The error message when I try to delete it looks like this.
rmdir : Access to the path 'C:\Tomcat8.0\webapps\geoserver\data\coverages' is denied.
At line:1 char:1
rmdir .\data
CategoryInfo : PermissionDenied: (C:\Tomcat8.0\webapps\geoserver\data:String) [Remove-Item], UnauthorizedAccessException
FullyQualifiedErrorId : RemoveItemUnauthorizedAccessError,Microsoft.PowerShell.Commands.RemoveItemCommand
I read that this can be caused by a bug in UAC (User Account Control), so I set it to Never notify, but that didn't change it either.
Background (I'm not sure if this caused the problem): The folder was created by deploying geoserver on Tomcat 8 and trying to manually delete it. The entire folder structure was deleted except for this one folder.
Edit: Maybe it's also worth mentioning that it doesn't matter whether Tomcat is running or not.

I figured out how to delete it now. The folder seemed to be locked by the explorer process somehow.
Solution: Open cmd as administrator, then stop the explorer task, delete the folder and start a new instance of explorer.exe.

The below solution:
Open cmd as administrator, then stop the explorer task,
or open the task manger and end task windows explorer
delete the folder and
start a new instance of explorer.exe from task manger (explorer).
This worked for me.

Related

Raising the nofile limit under WSL2 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm not what you would call an advanced linux user, so my apologies for a probably dumb question.
I'm trying to raise the NOFILE limit for my UBUNTU 20.04 distro using WSL2, following this guide: cannot-increase-open-file-limit-past-4096-ubuntu
However, when I try to modify the corresponding .conf files I get a permision denied error.
When trying to do so from windows and VsCode I get:
Failed to save 'system.conf': Command failed: "C:\Users\sague\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd" --file-write "c:\Users\sague\AppData\Roaming\Code\code-elevated-mjlcag" "\\wsl$\Ubuntu-20.04\etc\systemd\system.conf" Error using --file-write: EPERM: operation not permitted, open '\\wsl$\Ubuntu-20.04\etc\systemd\system.conf'
And when trying to do so using nano within the WSL2 terminal (using windows terminal) I get:
Error writing /etc/systemd/system.conf: Permission denied
Please help, I'm stuck with this :')
My apologies for what is probably a very noob question
Well, to be honest you are making a few newbie mistakes, but don't worry - Even once you get past those, what you are trying to do under WSL isn't easy.
First, you are trying to edit a system file as a normal user in nano, resulting in Permission denied. Solution: Use sudo nano /etc/systemd/system.conf instead. But see below (3) for why this ultimately isn't going to work.
Second, you are trying to edit a WSL system file as a normal user under VSCode. This just won't work since VSCode always runs as the normal user by design. It may be possible to get it to run under sudo, but it's probably not worth the effort. Note that this is also a limitation when running the "Remote - SSH" extension in VSCode (similar to the "Remote - WSL" one you are using now).
You are trying to modify the systemd configuration under WSL, where there is no systemd support, so even when you do successfully edit the file, it isn't going to do anything.
Your next attempt once you got past that would probably be (as it is for most of us) to try to raise the ulimit through /etc/security/limits.conf, which is the right way to do it, but requires a trick under WSL. That file is a PAM construct, and ... well, PAM runs at login, and we don't "login" in WSL, so PAM usually doesn't get called.
The hacky solution, as I cover in this answer on Ask Ubuntu (with great assistance from a number of answers in this Github thread) is to make the modifications to /etc/security/limits.conf and then to force PAM to process it by sudo'ing back in as your own user via:
sudo su $USER
or possibly
sudo su - $USER # if you need to run as a login shell
There are also some other suggestions in the Github thread, if those incantations don't quite work for you.

Unkown permission issues preventing wsl2 from accessing random windows files/directories [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm having permissions issues when accessing seemingly random directories/files on the windows filesystem with wsl2/ubuntu. Some directories are not accessible and I get a 'permission denied' error when I try to access them or any of the files in them. However, I have no issues accessing them from Windows itself through explorer or a non-admin powershell or command-line shell.
From the WSL side I am the owner of the files and directories and have correct permissions but I still cannot access them. I can however access these directories/files if I switch to root. I shouldn't have to though since the permissions on this directory are the same as the ones on other directores.
drwxr-xr-x me me
I've tried looking at the directory properties from the Windows side and making them more permissive ("Full-control" to each group in the properties>security menu) to all of the various groups with no success. I am the only user of this computer and the only groups that exist are...
Authenticated Users
SYSTEM
Administrators (${my-machine-name}\Administrators)
Users (${my-machine-name}\Users)
I can provide more info if needed.
Make sure that not only the directory that contains the files has rx for your WSL user but also every directory above it (Sorry, would have commented but I don't have enough rep yet).
Try creating a /etc/wsl.conf with the following:
[automount]
options="metadata,uid=1000,gid=1000,umask=022"
After creating the file:
Exit your WSL session
wsl --terminate <distro> or wsl --shutdown
Then restart and test the file/directory permissions again.
The uid and gid probably already default to those values since you mention that the files and directories on the NTFS drive are showing as owned by your user. So they can probably be left out.
The metadata option is important, as it allows WSL to map Linux permissions on to files and directories created in WSL on those NTFS drivers. But again, this isn't really your problem here either.
The umask is hopefully the long-term answer to your problem, as it will map WSL/Linux rwxr-xr-x to directories created in Windows, and rw-r–r– to files.

SSH Permission denied (publickey) DigitalOcean Ubuntu [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I can't seem to log in to my droplet on digitalocean.
When I try ssh root#162.243.123.123 I get a Permission denied (publickey). I tried resetting the root password and logging in via the digitalocean droplet console, but it won't take the root login or password that was reset. Nor will it take the other username and password that I set up.
Everything was working fine yesterday, but when I started work today I ran into the Permission denied issue. So I'm not sure what changed to make this no longer work. I also checked my github keys to see if it hadn't been added, but my local machines key is there and correct. I've also tried adding the key to the droplet with ssh-copy-id admin#162.243.123.123, but got the same error.
Looking at the keys found when logging into the digitalocean website shows the correct key.
The issue was on the server-side authorized_keys, but not the ~/.ssh/authorized_keys. It was in a separate /home/user/.ssh/authorized_keys file, where I had to add the ssh-keys. Once I did this the issue went away. Not sure how it got removed from that file since I hadn't modified it.
This video helped.

WinSCP Cannot overwrite. Permission issues [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
On my remote server A, I have a bunch of .py files.
I drag those files to a Windows machine, B, via WinSCP.
I work on these files on the Windows machine and want to import them back to server A via WinSCP.
When I try that, it says "cannot overwrite".
Obviously it's a permissions issue. I am not sure how much permission I need to give in order to have the overwrite access.
Currently, I have -r--r--r-- on these files for reading.
I am guessing I need write access? Or do I need execute access as well?
Will chmod 755 * be sufficient? I want to be careful with permissions so I am asking on here.
That depends on what users are owner of the files and the one you connect with SCP.
If they are the same, then '-rw-r--r--' should be enough.
If they are on the same group then -rw-rw-r--

scp error when copying files [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am trying to use the scp command but I'm getting the following error:
permission denied
lost connection
I get this when I use scp to copy a file from a master node to a slave node.
This is probably more like your error, ya?
Permission denied (publickey).
lost connection
The simplest problem is that you don't have permissions to access the directories specified on at least one end of the copy operation, or you may just have a bad login.
You could try using sudo chown -R
*username* to make sure you have rights to the target directories on
both ends.
Check your directory specifications, make sure that you are using ~/Documents for instance instead of /Documents. Very different locations.
If you've got a bad login, I can't help you there, sorry. Try just ssh-ing into the target(s) make sure you can.
You could check out the manpage for more help
I think error in giving permission to folder which has the authorized_keys file
use chmod and set the permissions