How do I update the default shell for all existing IPA/IdM users in RHEL 6?

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux 6.x
  • IPA
  • IdM Server

Issue

  • How can I mass update all existing IPA/IdM users to a different shell?

Resolution

  • At this time, there is no way to perform this operation through the IPA web UI. Presently, the best option available is a script similar to the example below, tailored to fit your specific environment.

  • The script below changes the default shell for all existing users from bourne shell to bash. Please keep in mind that Red Hat does not support custom scripts of any kind.

#!/bin/bash
for user in `ipa user-find --shell=/bin/sh |grep "^ User login:"|awk -F"^ User login: " '{print $2}'` # that loops all the usernames of users with shell "/bin/sh"
do
ipa user-mod $user --shell=/bin/bash # that modifies the shell to /bin/bash
done

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.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.