user?
Determine if a uid or user name is a user in ruby
Basic Usage
require 'kanrisuru'
host = Kanrisuru::Remote::Host.new(host: '127.0.1.1', username: 'ubuntu', keys: ['~/.ssh/id_rsa'])
host.user?('ubuntu')
true
host.user?('centos')
false
host.user?(0)
true
Parameters
Field | Type | Description |
---|---|---|
user |
string
integer
|
Required name / uid of the user to determine if it exists on the remote host. |
Tested On
- Ubuntu, Debian, Centos, Fedora, Redhat, OpenSuse, SLES