Converting existing accounts to Userify Accounts
By design, Userify plays well with other management systems and does not manage user accounts that it did not create. (For example, root, backup, system accounts, etc.)
The trigger that tells Userify if it is dealing with a userify account is the presence of
userify- in the comment field in /etc/passwd.
Here is an example of updating user accounts that may already exist on a system to convert them to Userify users by changing those user's comment fields. (Note: if the username doesn't exist in Userify or does not have permissions in the server when executing this script, the user account will of course be removed as you would expect, but can easily be restored as soon as the user is created or granted permissions in Userify.)
You will need sudo access on the remote servers (meaning that you have root access granted in Userify) in order to make these user comment field changes.
#! /bin/bash for un in bob alice do cmd="$cmd; sudo usermod -c userify-legacy-$un $un" done for hn in hostname1 hostname2 hostname3 do echo "$cmd" | ssh $hn & done