SlideShare a Scribd company logo
1 of 26
Download to read offline
Adding New Users
and
Storage
Prepared By
Prof. Bhushan Pawar
www.bhushanpawar.com
Prof.Bhushan Pawar
www.bhushanpawar.com
1
The /etc/passwd file
• /etc/passwd file is a list of users recognized by
the system.
• The system consults /etc/passwd at login time
to determine a user’s UID and home directory,
among other things.
Prof.Bhushan Pawar
www.bhushanpawar.com
2
Continue…
• It contains seven fields separated by colons:
• Login name
• Encrypted password
• UID (user ID) number
• Default GID (group ID) number
• “GECOS” information: full name, office,
extension, home phone
• Home directory
• Login shell
Prof.Bhushan Pawar
www.bhushanpawar.com
3
Continue…
• E.g
root:x:0:0:The System,,x6096,:/:/bin/sh
- The passwd file contains an x in the encrypted
password field on Linux, Solaris.
• The actual encrypted passwords are stored in
/etc/shadow on Linux, Solaris.
Prof.Bhushan Pawar
www.bhushanpawar.com
4
Login name
• Must be unique and, depending on the
operating system, may have length and
character set restrictions.
• Login names can never contain colons or
newlines because these characters are used as
field separators and entry separators.
Prof.Bhushan Pawar
www.bhushanpawar.com
5
Continue…
Prof.Bhushan Pawar
www.bhushanpawar.com
6
Encrypted password
• The encrypted password in the /etc/passwd
file
Prof.Bhushan Pawar
www.bhushanpawar.com
7
UID (user ID) number
• UIDs are usually unsigned 32-bit integers.
• Root has UID 0.
Prof.Bhushan Pawar
www.bhushanpawar.com
8
Default GID number
• A group ID number is a 32-bit integer.
• GID 0 is reserved for the group called root or
system.
• The /etc/group file defines the groups, with
the GID field in /etc/passwd providing a
default (or “effective”) GID at login time
Prof.Bhushan Pawar
www.bhushanpawar.com
9
GECOS field
• The GECOS field is sometimes used to record
personal information about each user.
• The chfn command lets users change their
own GECOS information.
• On most systems chfn understands only the
/etc/passwd file
Prof.Bhushan Pawar
www.bhushanpawar.com
10
Home directory
• If the home directory is missing at login time,
the system prints a message such as “no
home directory” and puts the user in /.
• On Linux, if /etc/login.defs sets
DEFAULT_HOME to no, the login is not
allowed to continue.
Prof.Bhushan Pawar
www.bhushanpawar.com
11
Login shell
• The login shell is normally a command
interpreter such as the Bourne shell or the C
shell (/bin/sh or /bin/csh), but it can be any
program.
• sh is the traditional default for UNIX, and bash
(the GNU “Bourne again” shell) is the default
for Linux and Solaris.
• tcsh is an enhanced C shell with command
editing.
Prof.Bhushan Pawar
www.bhushanpawar.com
12
THE /ETC/SHADOW AND
/ETC/SECURITY/PASSWD FILES
• A shadow password file is readable only by
the superuser and serves to keep encrypted
passwords.
• IBM calls the file that stores the encrypted
passwords /etc/security/passwd, while the
rest of the world calls it /etc/shadow.
Prof.Bhushan Pawar
www.bhushanpawar.com
13
/etc/shadow
• The shadow file is not a superset of the
passwd file, and the passwd file is not
generated from it. We must maintain both
files or use tools such as useradd that
maintain both files on your behalf. Like
/etc/passwd, /etc/shadow contains one line
for each user. Each line contains nine fields,
separated by colons
Prof.Bhushan Pawar
www.bhushanpawar.com
14
Continue…
• Login name
• Encrypted password
• Date of last password change
• Minimum number of days between password changes
• Maximum number of days between password changes
• Number of days in advance to warn users about password
expiration
• Linux: Days after password expiration that account is disabled
Solaris/HP-UX: Days before account automatically expires
• Account expiration date
• A reserved field that is currently always empty, except on
Solaris Prof.Bhushan Pawar
www.bhushanpawar.com
15
THE /ETC/GROUP FILE
• The /etc/group file contains the names of UNIX
groups and a list of each group’s members.
• Each line represents one group and contains four
fields:
• Group name
• Encrypted password or a placeholder
• GID number
• List of members, separated by commas (be
careful not to add spaces)
Prof.Bhushan Pawar
www.bhushanpawar.com
16
example
1. system:!:0:root,pconsole,esaadmin
2. staff:!:1:ipsec,esaadmin,trent,ben,garth,evi
3. bin:!:2:root,bin
4. sys:!:3:root,bin,sys
5. adm:!:4:bin,adm
6. nobody:!:4294967294:nobody,lpd
Prof.Bhushan Pawar
www.bhushanpawar.com
17
ADDING USERS: THE BASIC STEPS
• The process of adding a new user consists of
several steps required by the system:
– Have the new user sign your policy agreement.
– Edit the passwd and shadow files to define the
user’s account.
– Add the user to the /etc/group file (not really
necessary, but nice).
– Set an initial password.
– Create, chown, and chmod the user’s home
directory.
– Configure roles and permissions
Prof.Bhushan Pawar
www.bhushanpawar.com
18
Continue…
• For the user:
– Copy default startup files to the user’s home
directory.
– Set the user’s mail home and establish mail
aliases.
• For you:
– Verify that the account is set up correctly.
– Add the user’s contact information and account
status to your database
Prof.Bhushan Pawar
www.bhushanpawar.com
19
Continue…
• You must be root to add a user, you must have
Admin privileges.
• This is a perfect place to use sudo.
• For this we can use “useradd” or “adduser”
command.
Prof.Bhushan Pawar
www.bhushanpawar.com
20
Editing the passwd and group files
• If you have to add a user by hand, use vipw to
edit the passwd and shadow files.
• NOTE:-
– On Solaris, and Red Hat systems, vipw
automatically asks if you would like to edit the
shadow file after you have edited the passwd file.
SUSE and Ubuntu systems use vipw -s for this
function.
Prof.Bhushan Pawar
www.bhushanpawar.com
21
Setting a password
• Set a password for the new user with
$ sudo passwd newusername
Prof.Bhushan Pawar
www.bhushanpawar.com
22
Creating the home directory and
installing startup files
• You can create the new user’s home directory
with a simple mkdir.
• Startup files traditionally begin with a dot and
end with the letters rc, short for “run command,”
• The initial dot causes ls to hide these
“uninteresting” files from directory listings unless
the -a option is used.
• Sample startup files are traditionally kept in
/etc/skel (Linux, Solaris, HP-UX) or /etc
Prof.Bhushan Pawar
www.bhushanpawar.com
23
Prof.Bhushan Pawar
www.bhushanpawar.com
24
Setting permissions and ownerships
• The command
– $ sudo chown -R newuser:newgroup ~newuser
Prof.Bhushan Pawar
www.bhushanpawar.com
25
Any Question???
• If you having any doubt then you can ask me
question on
bhushan.pawar@mescoepune.org
Or
contact me on (+91)-7588318728
Prof.Bhushan Pawar
www.bhushanpawar.com
26

More Related Content

What's hot

Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems senthilamul
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file systemTaaanu01
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Tushar B Kute
 
Unix & Linux File System in Operating System
Unix & Linux File System in Operating SystemUnix & Linux File System in Operating System
Unix & Linux File System in Operating SystemMeghaj Mallick
 
From Drives to URLs
From Drives to URLsFrom Drives to URLs
From Drives to URLsadil raja
 
File system structure in linux
File system structure in linuxFile system structure in linux
File system structure in linuxSukkur IBA
 
Module 1 introduction to Linux
Module 1 introduction to LinuxModule 1 introduction to Linux
Module 1 introduction to LinuxTushar B Kute
 
Linux fundamentals Training
Linux fundamentals TrainingLinux fundamentals Training
Linux fundamentals TrainingLove Steven
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure amol_chavan
 

What's hot (20)

Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems Unix file systems 2 in unix internal systems
Unix file systems 2 in unix internal systems
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Linux training
Linux trainingLinux training
Linux training
 
Linux: Basics OF Linux
Linux: Basics OF LinuxLinux: Basics OF Linux
Linux: Basics OF Linux
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
 
Unix & Linux File System in Operating System
Unix & Linux File System in Operating SystemUnix & Linux File System in Operating System
Unix & Linux File System in Operating System
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
From Drives to URLs
From Drives to URLsFrom Drives to URLs
From Drives to URLs
 
File system structure in linux
File system structure in linuxFile system structure in linux
File system structure in linux
 
Module 1 introduction to Linux
Module 1 introduction to LinuxModule 1 introduction to Linux
Module 1 introduction to Linux
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
 
Unix Administration 3
Unix Administration 3Unix Administration 3
Unix Administration 3
 
Mac2
Mac2Mac2
Mac2
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
Mac2
Mac2Mac2
Mac2
 
Mac2
Mac2Mac2
Mac2
 
Linux fundamentals Training
Linux fundamentals TrainingLinux fundamentals Training
Linux fundamentals Training
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
 

Similar to Unit 6 adding new users and storage

Unit 5 access control,rootly powers & controlling processes
Unit 5 access control,rootly powers & controlling processesUnit 5 access control,rootly powers & controlling processes
Unit 5 access control,rootly powers & controlling processesBhushan Pawar -Java Trainer
 
Death matchtournament del2014
Death matchtournament del2014Death matchtournament del2014
Death matchtournament del2014Nabil Munawar
 
File system discovery
File system discovery File system discovery
File system discovery DevMix
 
Linux Basics
Linux BasicsLinux Basics
Linux BasicsLokesh C
 
Topic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptxTopic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptxdulala3
 
06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissionsShay Cohen
 
How to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MNHow to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MNGene Kartavtsev
 
Linux week 2
Linux week 2Linux week 2
Linux week 2Vinoth Sn
 
Server quickstart47 linux
Server quickstart47 linuxServer quickstart47 linux
Server quickstart47 linuxkb_exchange_hk
 
24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAs24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAsKellyn Pot'Vin-Gorman
 
7 unixsecurity
7 unixsecurity7 unixsecurity
7 unixsecurityricharddxd
 

Similar to Unit 6 adding new users and storage (20)

Linux
Linux Linux
Linux
 
Unit 5 access control,rootly powers & controlling processes
Unit 5 access control,rootly powers & controlling processesUnit 5 access control,rootly powers & controlling processes
Unit 5 access control,rootly powers & controlling processes
 
Linux privesc.pptx
Linux privesc.pptxLinux privesc.pptx
Linux privesc.pptx
 
Death matchtournament del2014
Death matchtournament del2014Death matchtournament del2014
Death matchtournament del2014
 
File system discovery
File system discovery File system discovery
File system discovery
 
Linux Basics
Linux BasicsLinux Basics
Linux Basics
 
Topic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptxTopic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptx
 
06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissions
 
3. introduction of centos
3. introduction of centos3. introduction of centos
3. introduction of centos
 
Linux 4 you
Linux 4 youLinux 4 you
Linux 4 you
 
How to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MNHow to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MN
 
CSA-lecture 6.pptx
CSA-lecture 6.pptxCSA-lecture 6.pptx
CSA-lecture 6.pptx
 
4. Centos Administration
4. Centos Administration4. Centos Administration
4. Centos Administration
 
3 technical-dns-workshop-day2
3 technical-dns-workshop-day23 technical-dns-workshop-day2
3 technical-dns-workshop-day2
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
Linux
LinuxLinux
Linux
 
Server quickstart47 linux
Server quickstart47 linuxServer quickstart47 linux
Server quickstart47 linux
 
24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAs24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAs
 
Tutorial 2
Tutorial 2Tutorial 2
Tutorial 2
 
7 unixsecurity
7 unixsecurity7 unixsecurity
7 unixsecurity
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Unit 6 adding new users and storage

  • 1. Adding New Users and Storage Prepared By Prof. Bhushan Pawar www.bhushanpawar.com Prof.Bhushan Pawar www.bhushanpawar.com 1
  • 2. The /etc/passwd file • /etc/passwd file is a list of users recognized by the system. • The system consults /etc/passwd at login time to determine a user’s UID and home directory, among other things. Prof.Bhushan Pawar www.bhushanpawar.com 2
  • 3. Continue… • It contains seven fields separated by colons: • Login name • Encrypted password • UID (user ID) number • Default GID (group ID) number • “GECOS” information: full name, office, extension, home phone • Home directory • Login shell Prof.Bhushan Pawar www.bhushanpawar.com 3
  • 4. Continue… • E.g root:x:0:0:The System,,x6096,:/:/bin/sh - The passwd file contains an x in the encrypted password field on Linux, Solaris. • The actual encrypted passwords are stored in /etc/shadow on Linux, Solaris. Prof.Bhushan Pawar www.bhushanpawar.com 4
  • 5. Login name • Must be unique and, depending on the operating system, may have length and character set restrictions. • Login names can never contain colons or newlines because these characters are used as field separators and entry separators. Prof.Bhushan Pawar www.bhushanpawar.com 5
  • 7. Encrypted password • The encrypted password in the /etc/passwd file Prof.Bhushan Pawar www.bhushanpawar.com 7
  • 8. UID (user ID) number • UIDs are usually unsigned 32-bit integers. • Root has UID 0. Prof.Bhushan Pawar www.bhushanpawar.com 8
  • 9. Default GID number • A group ID number is a 32-bit integer. • GID 0 is reserved for the group called root or system. • The /etc/group file defines the groups, with the GID field in /etc/passwd providing a default (or “effective”) GID at login time Prof.Bhushan Pawar www.bhushanpawar.com 9
  • 10. GECOS field • The GECOS field is sometimes used to record personal information about each user. • The chfn command lets users change their own GECOS information. • On most systems chfn understands only the /etc/passwd file Prof.Bhushan Pawar www.bhushanpawar.com 10
  • 11. Home directory • If the home directory is missing at login time, the system prints a message such as “no home directory” and puts the user in /. • On Linux, if /etc/login.defs sets DEFAULT_HOME to no, the login is not allowed to continue. Prof.Bhushan Pawar www.bhushanpawar.com 11
  • 12. Login shell • The login shell is normally a command interpreter such as the Bourne shell or the C shell (/bin/sh or /bin/csh), but it can be any program. • sh is the traditional default for UNIX, and bash (the GNU “Bourne again” shell) is the default for Linux and Solaris. • tcsh is an enhanced C shell with command editing. Prof.Bhushan Pawar www.bhushanpawar.com 12
  • 13. THE /ETC/SHADOW AND /ETC/SECURITY/PASSWD FILES • A shadow password file is readable only by the superuser and serves to keep encrypted passwords. • IBM calls the file that stores the encrypted passwords /etc/security/passwd, while the rest of the world calls it /etc/shadow. Prof.Bhushan Pawar www.bhushanpawar.com 13
  • 14. /etc/shadow • The shadow file is not a superset of the passwd file, and the passwd file is not generated from it. We must maintain both files or use tools such as useradd that maintain both files on your behalf. Like /etc/passwd, /etc/shadow contains one line for each user. Each line contains nine fields, separated by colons Prof.Bhushan Pawar www.bhushanpawar.com 14
  • 15. Continue… • Login name • Encrypted password • Date of last password change • Minimum number of days between password changes • Maximum number of days between password changes • Number of days in advance to warn users about password expiration • Linux: Days after password expiration that account is disabled Solaris/HP-UX: Days before account automatically expires • Account expiration date • A reserved field that is currently always empty, except on Solaris Prof.Bhushan Pawar www.bhushanpawar.com 15
  • 16. THE /ETC/GROUP FILE • The /etc/group file contains the names of UNIX groups and a list of each group’s members. • Each line represents one group and contains four fields: • Group name • Encrypted password or a placeholder • GID number • List of members, separated by commas (be careful not to add spaces) Prof.Bhushan Pawar www.bhushanpawar.com 16
  • 17. example 1. system:!:0:root,pconsole,esaadmin 2. staff:!:1:ipsec,esaadmin,trent,ben,garth,evi 3. bin:!:2:root,bin 4. sys:!:3:root,bin,sys 5. adm:!:4:bin,adm 6. nobody:!:4294967294:nobody,lpd Prof.Bhushan Pawar www.bhushanpawar.com 17
  • 18. ADDING USERS: THE BASIC STEPS • The process of adding a new user consists of several steps required by the system: – Have the new user sign your policy agreement. – Edit the passwd and shadow files to define the user’s account. – Add the user to the /etc/group file (not really necessary, but nice). – Set an initial password. – Create, chown, and chmod the user’s home directory. – Configure roles and permissions Prof.Bhushan Pawar www.bhushanpawar.com 18
  • 19. Continue… • For the user: – Copy default startup files to the user’s home directory. – Set the user’s mail home and establish mail aliases. • For you: – Verify that the account is set up correctly. – Add the user’s contact information and account status to your database Prof.Bhushan Pawar www.bhushanpawar.com 19
  • 20. Continue… • You must be root to add a user, you must have Admin privileges. • This is a perfect place to use sudo. • For this we can use “useradd” or “adduser” command. Prof.Bhushan Pawar www.bhushanpawar.com 20
  • 21. Editing the passwd and group files • If you have to add a user by hand, use vipw to edit the passwd and shadow files. • NOTE:- – On Solaris, and Red Hat systems, vipw automatically asks if you would like to edit the shadow file after you have edited the passwd file. SUSE and Ubuntu systems use vipw -s for this function. Prof.Bhushan Pawar www.bhushanpawar.com 21
  • 22. Setting a password • Set a password for the new user with $ sudo passwd newusername Prof.Bhushan Pawar www.bhushanpawar.com 22
  • 23. Creating the home directory and installing startup files • You can create the new user’s home directory with a simple mkdir. • Startup files traditionally begin with a dot and end with the letters rc, short for “run command,” • The initial dot causes ls to hide these “uninteresting” files from directory listings unless the -a option is used. • Sample startup files are traditionally kept in /etc/skel (Linux, Solaris, HP-UX) or /etc Prof.Bhushan Pawar www.bhushanpawar.com 23
  • 25. Setting permissions and ownerships • The command – $ sudo chown -R newuser:newgroup ~newuser Prof.Bhushan Pawar www.bhushanpawar.com 25
  • 26. Any Question??? • If you having any doubt then you can ask me question on bhushan.pawar@mescoepune.org Or contact me on (+91)-7588318728 Prof.Bhushan Pawar www.bhushanpawar.com 26