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.
To assign sudo rights to a user or group, do the following:
- 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 groupnamesudo usermod -a -G groupname usernamegrep groupname /etc/group
- On your Linux client machine, open Terminal.
- Enter the below command and submit your password if prompted.sudo visudo
- 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
- 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.
- 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.
- When you are done editing the file, hit Escape to exit insert mode.
- 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.:wq
- Within Lansweeper, rescan the client machine with the user account you granted sudo rights to. The LinuxNoSudoRights errors should now be resolved.