get_uid
Gets a user uid in ruby
linux manual
Basic Usage
require 'kanrisuru'
host = Kanrisuru::Remote::Host.new(host: '127.0.1.1', username: 'ubuntu', keys: ['~/.ssh/id_rsa'])
result = host.get_uid('ubuntu')
result.success?
true
result.to_i
1000
Parameters
Field | Type | Description |
---|---|---|
user |
string
|
Required name of the user to get uid. |
Result
Returns an integer of the user’s uid.
Tested On
- Ubuntu, Debian, Centos, Fedora, Redhat, OpenSuse, SLES