am as root and Els says I am not (Ubuntu 14.04)

Asked

Viewed 63 times

-4

After the installation of ELS (easy linux secutiry) when I will give the following commands:

els --update; els --chkrootkit; els --rkhunter; els --chmodfiles; els --disabletelnet; els --hardensysctl; els --libsafe; els --mytop; els ---securepartitions

the terminal tells me I’m not logged in as root, AND I AM YES!!... I tried to perform putting sudo and tbm says q am not root... look below:

erro não sou root

Please help me, I thank you in advance!

  • I read your reply (as Guilherem said should be a comment), and I think it is worth commenting here that, according to the website ELS, the program has not been updated since 2009. So I recommend you look for other options to protect your VPS.

1 answer

1

I don’t really have an explanation of why this occurs, but the following made the command work for me:

In the Els.sh installed (on my computer it got on /usr/local/Els/), you will find the following on line 86 of the code:

## Make sure the script is being executed as root
rootcheck() {
   if [ "${UID}" != "0" ]; then
      echo "This program must be run as root.  Exiting."
      exit 0
   fi
}

Modify the if for:

## Make sure the script is being executed as root
rootcheck() {
   if [ "$(id -u)" != "0" ]; then
      echo "This program must be run as root.  Exiting."
      exit 0
   fi
}

With this modification the command behaves as expected:

  • Running as normal user:

    $ els --version
    This program must be run as root.  Exiting.
    
  • And as root:

    # els --version
    ELS version is 3.0.0.3. It is the latest release, there is no need to update.
    
  • 2

    And do you think you can trust a script that apparently wasn’t made for your distro? (at least depending on ${UID} being set correctly indicates this). I wonder what other unresolved dependencies the script might have.

  • @Bacco yes I agree too, the likely problem should be a lack of apt-get update or upgrade and downloaded some wrong version, or tried to install manually, does not seem to me a problem within the scope of the community, I think the question should be closed and simply this, the most that could answer is how to install the updated version and not how to "modify". But I’m not sure of the problem... +1 Bacco for your comment

  • Well, if you go to the ELS http://servermonkeys.com/els.phppage, you will see that the program has not been updated since 2009, so it was not made for several distros :). Still, if @Danielfortunato really needs to run this program on Ubuntu 14.04, this is a Dirty-Quick fix that lets him do it. But like you said, it’s not recommended.

  • our brother thank you very much, solved even Aki, now my VPS is safer, vlwww!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.