userinfo

command module
v0.0.0-...-38cbf26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

README

User operations in Linux

Display linux user information or create / delete user.

Usage

Usage of ./run:
  -alsologtostderr
    	log to standard error as well as files
  -create
    	Creates the system user
  -delete
    	Deletes the system user
  -from string
    	Json configuration for create user
  -list
    	Lists the system users
  -log_backtrace_at value
    	when logging hits line file:N, emit a stack trace
  -log_dir string
    	If non-empty, write log files in this directory
  -logtostderr
    	log to standard error instead of files
  -stderrthreshold value
    	logs at or above this threshold go to stderr
  -user string
    	List specific system user
  -v value
    	log level for V logs
  -vmodule value
    	comma-separated list of pattern=N settings for file-filtered logging

Add new user
./run -create -from ./usr.json -logtostderr

Enter Password for test: 
User test added

Example usr.json :
{
   "uid": "0",
   "gid": "0",
   "userName": "test",
   "groupName": "syslog",
   "name": "Test User",
   "homeDir": "/home/test"
}
User information
./run -logtostderr -list -user test
{
   "uid": "1002",
   "gid": "1002",
   "userName": "test",
   "groupName": "test",
   "homeDir": "/home/test"
}
List all users
./run -logtostderr -list
{
   "users": [
      {
         "uid": "0",
         "gid": "0",
         "userName": "root",
         "groupName": "root",
         "name": "root",
         "homeDir": "/root"
      },
      {
         "uid": "1",
         "gid": "1",
         "userName": "daemon",
         "groupName": "daemon",
         "name": "daemon",
         "homeDir": "/usr/sbin"
      },
      {
         "uid": "2",
         "gid": "2",
         "userName": "bin",
         "groupName": "bin",
         "name": "bin",
         "homeDir": "/bin"
      },
...
...
Delete user
./run -logtostderr -delete -user test
test user deleted.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL