Editing the file "config.inc.php" - xampp

I put my password into he config.inc.php file because I couldn’t access phpmyadmin in xampp server. But after editing the file, I can' save it.
Error
"You do not have the permissions necessary to save the file. Please
check that you typed the location correctly and try again."
how can i get rid of this?

Please Open Same File With Sudo Permission
Go to that perticular Directory via terminal
after that edit file by
sudo nano config.inc.php
or just
sudo nano /etc/phpmyadmin/config.inc.php
Enter Password

You might wanna go through this. This might be the solution you are looking for.
http://blog.elijaa.org/index.php?post/2013/02/19/Solve-Wrong-permissions-on-configuration-file%2C-should-not-be-world-writable!-error-on-phpMyAdmin

$ cd /opt/lampp/htdocs/myapp
$ chown bitnami.root config/myapp.php

Related

Visual Studio Code always asks for sudo permissions

Ok, so I've got a problem with VSCode where every time I try to save a file it asks me for sudo permission and it's really annoying and I can't make folders or files directly in the IDE. Can please someone help me?
Screenshot from VSCode
The running instance of VS Code doesn't seem to have write permission to the file you wish to save.
Since the file is in the directory of user uteu3, first make sure that it is user uteu3 that has started VS Code (it probably is, if uteu3 is the user logged into the system).
make sure uteu3 is the owner of the file and change the permissions by opening a terminal and executing:
sudo chown uteu3 filename && sudo chmod 664 filename
(Replace filename with actual path+name to the file.)
If this doesn't solve the problem, please execute the following two lines in a terminal and provide the output:
ps aux | grep visual-studio-code
stat -f '%A %a %N' filename
Since you indicate that this happens repeatedly also with other files, maybe several of the file permissions in your home directory are problematic. In that case, consider trying to fix them all. See for example: Need to fix file permissions in a user's home directory
.

How to open file as root in GUI text editor on mac os

I need all my files in certain directory to be accessible only by root. So I do the chown and chmod commands to set privileges to 700 template where file owner is root. After that if I open files with nano everything works ok: if I run it with sudo I can see contents of files and edit it; if not root then I can see just an empty file which I can't edit or modify. Then I try to open files with Sublime2 as subl 1.txt. With or without sudo it just appears to show an empty file. Then I try sudo open 1.txt to open with the default TextEditor and then I see a message that I don't have permissions. The same if I try anything like sudo open -a (any other text editor from my apps) 1.txt the permissions message is shown. I've tried to google for gksu for mac but people say that sudo is enough. Please guys, any ideas on the topic are welcome. Thank you much!

Permission denied when I try to open the browser and a specific URL from shell

I would like to open the browser(no matter which), and browse a specific website, say, youtube.com. And I'd like to run it from a .sh file.
I have tried:
1.python -mwebbrowser http://youtube.com
2.gnome-open "http://www.youtube.com"
3.xdg-open "http://www.youtube.com"
4.open "http://www.youtube.com"
All of them got zsh: permission denied: ./try.sh error. How can I solve this problem? Thank you in advance!
it sounds like the try.sh file itself is missing executable permissions. please try doing:
chmod a+rx try.sh

sudo open -e ~/.bash_profile Permission denied mac

I am trying to edit bash_profile file to add path to my sdk through the following command on my mac machine.
sudo touch ~/.bash_profile; open -e ~/.bash_profile
It opens the file in TextEdit but does not allow me to edit it. Though i have given super-user permission and password while running the above command. It is giving me following message when i try to edit it.
"You don’t own the file “.bash_profile” and don’t have permission to write to it.
You can duplicate this document and edit the duplicate. Only the duplicate will include your changes."
I am new to mac. So please elaborate your answers.
The problem is that the file isn't owned by your user, but by root. You need to change the owner of the file to your user, then you can open and edit the file without the use of sudo:
sudo chown farheen ~/.bash_profile
This will, as the super-user, change the owner of the file back to you.
For Mac User Catalina,
.bash_profile not open, they need grant permission to edit this file. You can achieve by below steps
1) Open the terminal and enter below command ex: sudo chown iMac ~/.bash_profile
sudo chown {your username} ~/.bash_profile
2) Open editor in the terminal, here i used nano
nano .bash_profile
3) Edit your text you want.
4) To save the changes you've made, press Ctrl + O
5) To exit nano, press Ctrl + X
6) And finally to load your changes, enter below command
source .bash_profile
OR
You can give permission and make it executable file using like below:
That error likely means that 'bash_profile' isn't executable. If it's in the current directory, you can make it executable with chmod +x bash_profile.

Trying to connect Terminal to recognize "mate" command for TextMate

Couldn't Create Link
Creating the link “/usr/bin/mate” failed with the following reason: Operation not permitted
I am getting this error when I attempt to link the terminal usage with TextMate.
I did this by going Help >> Terminal Usage...
And I tried to create a link in /usr/bin.
I think the problem is something to do with permission issue.
I am wondering if there is a way to work around this problem by changing bash file directly or something and make terminal recognize "mate" as a command.
Thank you for any suggestion.
Assuming Textmate is installed in /Applications the following command in the terminal should manually create the link for you:
$ sudo ln -s /Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate /usr/bin
The command will ask you for your user account's password so it has the permissions necessary to create the link in /usr/bin/
There should be an option to create it in /usr/local/bin. Create it there. Make sure /usr/local/bin is in your $PATH.

Resources