LinuxNoSudoRights error during Linux scanning

Lansweeper needs sudo rights to scan certain Linux information. If your scanning credential does not have these rights, this may result in LinuxNoSudoRights errors during Linux scanning. To give your user account sudo permissions and to resolve the LinuxNoSudoRights errors for future scans, follow the steps below on your client machines. You can give an individual user sudo rights or make the user a member of a group that has sudo rights.

Be careful when editing system files, as making incorrect changes may make your system unstable. Also be mindful of the fact that different Linux distributions may require different commands to configure.

To assign sudo rights to a user or group, do the following:

  1. Make sure you've created the user or group you want to assign sudo rights to. If necessary, you can create a new group using Terminal by running the first command listed below. Groupname must be replaced with your preferred group name. You can then add a user to the group by running the second command listed below. Groupname and username must again be replaced with your own values. Finally, you can use the third command to list the users that are in a particular group. The members and lid/libuser-lid commands may also be used to list users in a group, but these commands are not always installed by default.
    sudo groupadd groupname
    sudo usermod -a -G groupname username
    grep groupname /etc/group
  2. On your Linux client machine, open Terminal.
  3. Enter the below command and submit your password if prompted.
    sudo visudo
    resolving LinuxNoSudoRights error
  4. Use the arrow keys to navigate through the file and locate a line that looks like one of the lines listed below. The first line gives an individual user permission to use sudo. The second line gives all members of a group permission to use sudo. Note the "%" before the group name. Common groups to have sudo rights are sudo and wheel.
    username ALL=(ALL) ALL
    %groupname ALL=(ALL) ALL
  5. Press "i" to enter insert mode, use the arrow keys to move the cursor and hit Enter to insert a new line. It is not recommended to remove existing lines from the file. Instead, add "#" to the start of a line to make the system ignore that line. This way, no information can be deleted by mistake.
  6. Add a line for each additional user or group you want to grant sudo rights. Use the same format as for the users and groups already in the file. In the example below, we gave sudo rights to a user called Lansweeper.
    giving a user sudo rights
  7. When you are done editing the file, hit Escape to exit insert mode.
  8. Type the below and hit Enter to save and exit the editor. To exit the editor without saving, hit Escape and then hit Ctrl+Z.
  9. Within Lansweeper, rescan the client machine with the user account you granted sudo rights to. The LinuxNoSudoRights errors should now be resolved.

Related Articles

Get Started Right Away

Try Lansweeper for Free