Delete a user in ruby.
host = Kanrisuru::Remote::Host.new(host: '127.0.1.1', username: 'ubuntu', keys: ['~/.ssh/id_rsa']) result = host.delete_user('kanrisuru') result.success? true host.user?('kanrisuru') false
||Required name / uid of the user to delete.|
||This option forces the removal of the user account, even if the user is still logged in. It also forces userdel to remove the user's home directory and mail spool, even if another user uses the same home directory or if the mail spool is not owned by the specified user. If USERGROUPS_ENAB is defined to yes in /etc/login.defs and if a group exists with the same name as the deleted user, then this group will be removed, even if it is still the primary group of another user.|
No explicit data struct returned, only option is
status to see if the program exited properly.
|1||Can't update password file|
|2||Invalid command syntax|
|6||Specified user doesn't exist|
|8||User currently logged in|
|10||Can't update group file|
|12||Can't remove home directory|
- Ubuntu, Debian, Centos, Fedora, Redhat, OpenSuse, SLES