I sometimes start Midnight Commander as superuser with the command sudo mc to do some operations on the current working directory as superuser.

But this results in ~/.mc having the wrong permissions, which I need to fix manually.

Any solution?


I accepted an answer. I want to further add, that .mc is a directory, so my solution goes like this:

$ cd ~  
~$ sudo chown -R mit.mit .mc
~$ chmod 775 .mc 
~$ cd .mc 
~$ chmod -R 664 .mc 
~/.mc$ chmod 775 cedit

It seems not to be a good idea after installing mc to use sudo on its first start.

  • You should post your solution as an answer and accept it instead of the incomplete one. – Melebius Nov 10 '16 at 7:27

You could change the permissions on your ~/.mc file like this:

chmod 664 ~/.mc

Make sure you do this as a regular user. This will set the permissions for the file to read and write for the owner (which should be your user) and root. And read only for anyone else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.