Wrong permissions after sudo midnight commander

5,041

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.

Share:
5,041

Related videos on Youtube

mit
Author by

mit

Updated on September 18, 2022

Comments

  • mit
    mit over 1 year

    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?

    Edit:

    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.

    • SK23
      SK23 over 7 years
      You should post your solution as an answer and accept it instead of the incomplete one.