Red Hat Linux Reference Guide

Linux Introduction

VI-EDITOR

Process Management

Linux Installation

Disk Partitions & File System Management

Logical Volume Management - LVM

User & Group Administration

Package Management

Network File System - NFS

Domain Naming System - DNS

Apache HTTP Web Server

KickStart Installations

FTP server

BOOT PROCESS

Dynamic Host Configuration Protocol - DHCP

Job Scheduling

File Links

Swap Management

Log Management

Performance Management

Linux Troubleshooting

Linux Summary

Start Preparation Smartly

We have the collection to start prepartion smartly.

Start Assessment

Red Hat Linux Reference Guide

  DevOps Tech Hub

116 Followers

Cron Job Summary


What is User?

In Linux, User is the one who  uses the system to  perform any  tasks. Linux has three type of  users to access the system.

  1. Root User: root useralso called as superuser and would have complete access to the system. root account can run any commands without any restriction hence this user called as System Administrator user and its  default user created with the Linux installation. 
  2. System User: System Users are those needed for the operation of system-specific components for example mail accounts and the sshd accounts. These System Users are created automatically with the specific software installation to manage the software programs. Usually we should not edit any property of  System Users as  that would effect the system behaviour. 
  3. Normal User : User Accounts that are created manually to access the system called as Normal Users. Normal Users granted with interactive shell access to  type commands to complete certain tasks. Usually  Normal Users are created to  grant and restrict access to  certain files are directories within the Linux System.

TYPE

EXAMPLE

USER ID (UID)

GROUP ID

HOME

SHELL

 

 

 

(GID)

DIRECTORY

 

Super User

Root

0

0

/root

/bin/bash

 

 

 

 

 

 

System User

ftp, ssh,

1 to 499

1 to 499

/var/ftp, etc...

/sbin/nologin

 

apache

 

 

 

 

 

Nobody etc…

 

 

 

 

Normal User

edwiki

500 to 60000

500 to 60000

/home/username

/bin/bash

 

test 

etc...

 

 

 

 

 

 

 

 

 

 


Users Attributes:

Whenever a user is created in Linux things created by default:-

  • A home directory is created(/home/username) 

 

  • A mail box is created(/var/spool/mail) 
  • unique UID & GID are given to user 

 

Linux uses UPG (User Private Group) scheme

  • It means that whenever a user is created is has its own private group 

 

  • For Example if a user is created with the name edwiki , then a primary group for that user will be edwiki only 

 

 



What is Group?

Linux supports creating Group which logically  grouping multiple users. Every user must be part of at least one group called as Primary Group.

Linux has two type of Groups:

  1. Primary Group
  2. Secondary Group

Groups are useful to manage file or directory permissions effectivey as it allows to grant the permission to  set of  users who are part of the same Group. 

Primary Group:

Every user is part of at least one group as Primary Group. When user creats file or directory then the default group of  file or directory is the primary group of the owner. 

Secondary Group

Its possible to create groups and assign users to the group. Secondary groups are more useful to grant additional permissions to the user to access files and directories of the same group.

How to see File Properties (Owner, Group, Permissions)

Edwiki#ls -l f1
-rw-r--r-- 1 root root 0 Aug 7 11:36 f1
Edwiki#

How to create user:

[root@ ~]$useradd iwayq

How to create group:

[root@ ~]$groupadd oracle

How to add users to the group

[root@ ~]$usermod -a -G oracle iwayq

How to change group of file or directory

[root@ ~]$ls -l f1
-rwxr--r-- 1 root root 0 Jun 27 02:04 f1
[root@ ~]$chgrp oracle f1
[root@ ~]$ls -l f1
-rwxr--r-- 1 root oracle 0 Jun 27 02:04 f1

How to see user groups

[root@ ~]$id iwayq
uid=1001(iwayq) gid=1001(iwayq) groups=1001(iwayq),1002(oracle)

How to delete user

[root@ ~]$userdel iwayq

How to delete group

[root@ ~]$groupdel oracle



Previous Next