Issue configure Charles proxy on Catalina - charles-proxy

When starting Charles after getting a new MacBook Pro with Catalina, I get the following message
Charles cannot configure your proxy settings while it is on a read-only volume

None on the above solutions worked for me. Both gives error as "Charles Proxy Settings" is not a directory
Instead of the file give the ownership & permission to the entire resources folder
sudo chown -R root "/Applications/Charles.app/Contents/Resources"
sudo chmod -R u+s "/Applications/Charles.app/Contents/Resources"

Found solution to this. After running this it worked fine. Previously, "Charles Proxy Settings" was in the MacOS directory and was recently moved to the Resources directory.
#!/bin/sh
SETTINGS_BIN="/Applications/Charles.app/Contents/Resources/Charles Proxy Settings"
chown root "${SETTINGS_BIN}"
chmod u+s "${SETTINGS_BIN}"

Good to me! Thanks
My Shell,as below
#!/bin/bash -il
# coding=UTF-8
cd ~
SETTINGS_BIN="/Applications/Charles.app/Contents/Resources/Charles Proxy Settings"
sudo chown root "${SETTINGS_BIN}"
sudo chmod u+s "${SETTINGS_BIN}"

Related

Flutter commands are not running

I'm trying to run the flutter commands but it gives me this error
Flutter failed to write to a file at
"/usr/local/Caskroom/flutter/3.0.3/flutter/bin/cache/flutter_version_check.sta
mp".
Please ensure that the SDK and/or project is installed in a location that has
read/write permissions for the current user.
Try running:
sudo chown -R $(whoami)
/usr/local/Caskroom/flutter/3.0.3/flutter/bin/cache/flutter_version_check.st
amp
please help how to fix this issue.
You have to give permission to your username to access that folder
sudo chown -R <your_username> /flutter_sdk_path/
Check permission for the mentioned directory via:
ls -l /usr/local/Caskroom/flutter
Then run this command:
sudo chown -R [user]:root /opt/flutter

VS Code: NoPermissions (FileSystemError): Error: EACCES: permission denied

I'm trying to save a file called app.js on a folder called js.
Vs Code pop up this:
Failed to save 'app.js': Unable to write file 'vscode-remote://wsl+ubuntu-18.04/js/app.js'
(NoPermissions (FileSystemError): Error: EACCES: permission denied, mkdir '/js')
I tried:
sudo chown -R user /mnt/c/Users/myUser/Documents/myFolder/proyectFolder
but I still can't save this file.
Try this, fixed it for me
sudo chown -R username path
Example:
sudo chown -R emanuel /home/emanuel/test/
In the SSH terminal:
Recommended :
sudo chmod -R 777 folder_name_where_your_file_exists
or
sudo chmod -R 755 folder_name_where_your_file_exists
this works for me
sudo chown -R $USER:$USER /home/
TLDR;
If you're using a docker container, avoid making files from within the container because the owner and group permissions may cause problems with your editor (in my case VS Code)
I was running docker container for a Django project from Windows Terminal and using VS Code to edit my code.
It is a Linux file (since everything in Linux is a file) permission problem that arises because the files don't have proper user and/or group permissions. So VS Code tries to tell us that.
The problem I found only happened when I created files from within my docker container.
I would run docker exec ... bash
make new files using touch /path/to/file from the container bash
then try to edit those files on VS Code (say urls.py) only to get the scary permissions error preventing the file from saving.
I suspect that making files from within the container embellishes those files with different owner and group settings than your system would default to if you just ran the commands locally (not in the container).
Changing the file permissions with chown -hR and chgrp -hR would do the trick but to avoid the error altogether I stopped making files from within the container.
Try activating polling:
This worked for me during I tried using wsl.
The below is for individual file:
sudo chown yourUserNAme filename
For an entire directory it will be (when you write ls to terminal, you should see your directory to execute this command):
sudo chown yourUserNAme dirName
For recursive (i.e files and folders inside a folder):
sudo chown -R yourUserNAme dirName
Note: yourUserNAme is, if you do pwd under any Documents, you will see the path: /home/jhon/Documents. Here user is jhon.
Run VS Code as administrator and it will fix the problem.
https://answers.microsoft.com/en-us/windows/forum/all/error-in-vs-code-destination-directory-and-says/e70dc626-6b12-4791-a960-8b704e57098d
Install the extension Save as Root in Remote SSH in VS code.
While saving press Ctrl + Shift + P.
This open the command palette.
Search Save as Root
It is a Linux user permissions problem.
you should use the command:
sudo chown -R $USER:$USER.

I am unable make file or directory in Visual Studio Code in Win Subsystem for Linux

I use this guide. When I take the step "Add a source code file", I am shown this report:
Unable to write file 'vscode-remote://wsl+ubuntu-20.04/home/alex/TEST/helloworld/helloworld' (NoPermissions (FileSystemError): Error: EACCES: permission denied, open '/home/alex/TEST/helloworld/helloworld')
I don't know what to do, can some one help me?
The VScode needs permissions thus
Try this command on your WSL terminal
sudo chown -R username /path/to/working/directory
Replace :
'username' with your username and the path of your directory
So I had the same problem and changing ownership via sudo chown -R username <path> did not work for me.
Simple solution!
My issue: Downloaded files for coursera project in zip. Copied files to ubuntu home/taylor/projects folder. and then tried accessing in vscode with code . I received the read error.
Solution:
go to your linux terminal.
Access the folder containing the files you are trying to work on.
For Example: app.py forms.py models.py in the projects folder. got to projects folder.
~/projects ls
app.py forms.py moodels.py routes.py
#they should be white meaning know permissions granted.
grant permissions
a. sudo chmod 777 app.py forms.py models.py routes.py
or
b. sudo chmod +rwx app.py forms.py models.py routes.py #r=read w=write x=execute
Try the above one by #uday Pratap, If not Working try this one's :
sudo chmod -R 777 folder_name_where_your_file_exists
or
sudo chmod -R 755 folder_name_where_your_file_exists

Unable to determine status of lock file in the data directory

I am trying to run multiple mongod instances on the same centos machine with different config files.
I am getting following error while running the instance as a service:
sudo service mongod1 start
/var/lib/mongo1: boost::filesystem::status: Permission denied: "/var/lib/mongo1/mongod.lock"
I have added the permissions for the /var/lib/mongo1 using:
sudo chmod -R 600 /var/lib/mongo1
I also tried with 700, 755 and 777 at the end but nothing seems to work.
mongod:mongod is the owner of the folder /var/lib/mongo1
Any help is appreciated.
I know this is really late but I was struggling with this for days and just now found the fix. That being said for future users running into this issue the solution if you're using SELinux is to check the context of the default mongodb path against your own to make sure they are the same by executing
ls -dZ /var/lib/mongo/
the output should look something like this
drwxr-xr-x. mongod mongod system_u:object_r:mongod_var_lib_t:s0 /var/lib/mongo/
if it's not then you can copy it by doing
chcon -R --reference=/var/lib/mongo /your/path
the source can be found here
Maybe the lock file is missing? Which might explain why chmod isn't having the desired effect...
Try:
touch /var/mongo1/mongod.lock
chown mongod:mongod
chmod 600 /var/mongo1/mongod.lock
important :
Don't try to restart mongo using sudo as it tries to change the user to root where as /var/lib/mongodb owner is mongod:mongod
Please remember that Directories needs to have execute permission, but the files within the directories do not need to execute permission.
The following 2 commands worked for me
$ sudo chmod -R 770 /var/lib/mongo1
$ sudo find /var/lib/mongo1 -type f -exec chmod 660 {} \;
This will first give everything under /var/lib/mongo1 execute permission, and then return all the normal files to having only read and write, but not execute.

RedHat 6/Oracle Linux 6 is not allowing key authentication via ssh

Keys are properly deployed in ~/.ssh/authorized_keys
Yet ssh keeps on prompting for a password.
Several issues, mostly privileges - but also related to SELinux on RedHat 6
The following script should fix them all, please replace <user>:<group> with your matching userid and group
chown -R <user>:<group> ~/.ssh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*
restorecon -R -v ~/.ssh
I'd agree with the changes above working on most linux variants in the root account.
I have had a problem with RedHat 6.3 with trying to get a postgres user account to use DSA auth. (6.3 running in VirtualBox)
The issue can be that the basic selinux permissions are wrong. Restorecon wont help in this case.
(After restorecon)
drwx------. postgres postgres unconfined_u:object_r:var_lib_t:s0 .ssh
I have fixed this with :
chcon -R -t ssh_home_t .ssh
This resolved this instance of the problem.
I had also this same issue, the proposed solution above did not solve the case for me. To summarise instructions abowe together:
Check following logfile on target system for possible details of errors: /var/log/secure
Permission of files in users ~/.ssh directory should be 600 and files should be owned By "user:group"
Permission of ~/.ssh directory should be 700 and owned By "user:group"
Permission of home directory of user ie. "~" (="~/.ssh/..") should be 755. If permissions are f.ex 775, ssh key autenthication failed in my system.
br
bruno
The above answer is quite good, I have an addition & a suggestion. The addition is in line 2 below, as home directory permissions not be more permissive than rwxr-x--- for ssh key authentication.
cd ~
chmod g-w,o-rwx .
chmod 700 .ssh
cd .ssh
chmod 600 *
chmod 644 authorized_keys
chmod 644 known_hosts
chmod 644 config
restorecon -R -v ../.ssh
The suggestion is to make use of the -vv option when testing.