Prerequisites for using Linux sudo credentials

  • Provide one of the following:

    • Username and password

    • Username and SSH key file path (in PEM format)

  • Give the sudo users write access to the /tmp directory.

  • For sudo users, add the user to the /etc/sudoers file. The following shows the privileges and specifications for users.

    • User: Root

      Privilege: ALL=ALL

      Specification: ALL

    • User: Sudo_user

      Privilege: ALL

      Specification: ALL

  • Edit the entry in the /etc/sudoers file so the system asks for the sudo user password instead of root user password when you run the sudo command.

  • The following shows the privileges to comment or remove from /etc/sudoers.

    • User: ALL

      Privilege: ALL

      Specification: ALL

    NOTE:

    Only use this option with Defaults targetpw on all systems.

  • To use super user functionality, configure the user as a super user with all root privileges. You can also use non-root user with a root user to update components.

  • When using SSH keys for login credentials combined with sudo, edit the entry in the /etc/sudoers file so that the system does not ask for the user password as follows:

    • User: sudo_user

      Privilege: ALL

      Specification: NOPASSWD:ALL