How to setup Remote Execution using non-root users with password?

Solution Verified - Updated

Environment

  • Red Hat Satellite 6
  • Remote Execution

Issue

  • How to setup Remote Execution using a non-root user with password on RHEL system connected to Red Hat Satellite 6?

Resolution

  • On the client machine create a user with a password set and add it to the sudoers.
[root@client ~]# useradd -m Remoteuser
[root@client ~]# passwd Remoteuser
Changing password for user Remoteuser.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

 [root@client ~]# echo "Remoteuser ALL=(ALL) ALL" > /etc/sudoers.d/Remoteuser
  • Verify if RemoteUser can execute the sudo commands with the password.
[root@client ~]# su - Remoteuser
[Remoteuser@client ~]# sudo fdisk -l
  • If RemoteUser user can execute commands without any issues, then Configure the "Global setting for Remote Execution" by making the following changes in the Satellite WebUI.

    Log in to Satellite WebUI -> Click on Administer -> Click on Settings -> Click on the RemoteExecution tab
    
  • Set the following parameter:-

    SSH User: Remote user
    Default SSH password: Password for the Remoteuser
    Effective User Method: sudo
    Effective User: root
    Effective User password: Password for the Remoteuser when running sudo
    

Note: Set Effective User to root user, as it will connect to the remote host as RemoteUser. Run sudo to change the user to Effective User and then run the job as that user.

  • Now Remote Execution jobs can be scheduled using a non-root user. If you dont want to provide Default SSH password, let distribute SSH keys to the client system:
ssh-copy-id -i ~foreman-proxy/.ssh/id_rsa_foreman_proxy.pub Remoteuser@HOST.FQDN

If you dont want to provide Effective User password for sudo, please follow this solution for more aligned sudoers configuration.

For more KB articles/solutions related to Red Hat Satellite 6.x Remote Execution Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Remote Execution Issues

SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.