Root access denied

I installed the pure-ftpd FTP server. I want to configure it. The server does not have a config. It perceives the settings as follows: in the /etc/pure-ftpd/conf directory there are files, each of which is responsible for one parameter. To configure something, you need to create a file with a specific name and write "yes" or "no"in it.

Trying to do this:

sudo echo no > /etc/pure-ftpd/conf/someparam

To which I am answered:

An error occurred while redirecting file '/etc/pure-ftpd/conf/someparam' open: Permission denied

How can a root have no access?

 2
Author: aleksandr barakin, 2015-08-16

1 answers

Sudo echo no > /etc/pure-ftpd/conf/someparam

The process started by the command echo no is executed on behalf of the privileged user.

And manipulations with the redirected stream stdout are performed by the current shell process, which, apparently, does not have write rights to the specified file.


There are two ways to go:

  1. It is necessary to write to the file on behalf of a privileged user, for example, so:

    $ echo no | sudo tee /etc/pure-ftpd/conf/someparam
    
  2. Perform both actions on behalf of this user, combining them into a single command passed to shell - y, for example, like this:

    $ sudo sh -c 'echo no > /etc/pure-ftpd/conf/someparam'
    
 4
Author: aleksandr barakin, 2015-08-16 10:23:44