Friday, May 6, 2022

[SOLVED] chmod. Changing permission of file

Issue

I have remote server with Debian and I need to edit readonly file fcgid.conf on server. When I use sudo:

sudo su chmod 755 fcgid.conf

it responses:

-bash: sudo: command not found

Also I tried cmod +x:

chmod +x fcgid.conf

And got:

chmod: changing permissions of `fcgid.conf': Operation not permitted

Owner of file is root user and I don't know how to get permission to edit this file.


Solution

Sudo is not installed with Debian in the case you have defined a root password in the installation.

Either install sudo with

$ apt-get update
$ apt-get install sudo

and make a sudo rule and add your user into the group:

$ adduser USERNAME sudo
$ visudo

enter:

%sudo ALL = (ALL) ALL

and then run again

$ sudo chmod +x fcgid.conf

see also here: How to properly configure sudoers file, on debian wheezy? or you try

$ su root

and then

$ chmod +x fcgid.conf

Both methods provide that you know the root/admin password...



Answered By - h0ch5tr4355
Answer Checked By - Clifford M. (WPSolving Volunteer)