class Inspec::Resources::FreeBSDUser

  • passwd(1) The command-line tool to change user passwords.
    - chpass(1) A flexible tool for changing user database information.
    - rmuser(8) The recommended command-line application for removing users.
    - adduser(8) The recommended command-line application for adding new users.
    It offers the following commands:
    @see: www.freebsd.org/cgi/man.cgi?pw(8)
    @see: www.freebsd.org/doc/handbook/users-synopsis.html<br>FreeBSD recommends to use the ‘pw’ command for user management

def meta_info(username)

def meta_info(username)
  cmd = inspec.command("pw usershow #{username} -7")
  return nil if cmd.exit_status != 0
  # returns: root:*:0:0:Charlie &:/root:/bin/csh
  passwd = parse_passwd_line(cmd.stdout.chomp)
  {
    home: passwd['home'],
    shell: passwd['shell'],
  }
end