Assign 2
Assign 2
Salma Lalji
Assign #2
COMP 2770
Company Policy
All usernames must be person’s first initial of their given name, and there full last
name.
Username length cannot be more than 8 characters.
No duplicate usernames
Password length must be at least 7 characters
% vi /etc/login.defs
Change the variable PASS_MIN_LEN to 7
System Developers
Tim Miller and Julie Smith belong to the same supplemental class “sysdev”.
Create new group with GID as 1000. user group will be default group. The next
group created will have the next corresponding GID of user group therefore no
need to specify it.
% groupadd –g 1000 users
% groupadd sysdev
Add password for both users. Remember to choose a password with at least 7
characters.
% passwd tmiller
% passwd jsmith
Change Tim and Julie’s default group to sysdev and Umask their directories so
as both can share files with each other create a file to check file permissions.
%su tmiller
%newgrp sysdev
% cd /home/tmiller
% umask 007
% touch file
% ll
%exit
Make sure file has rights to rw owner and group.
%su jsmith
%newgrp sysdev
% cd /home/jsmith
% umask 007
% touch file
% ll
% exit
Their password should expire each month and locked if now changed.
- n min # of days before password change = 30
- x max # of days before expire
- w warning before expire
- i # of days after expired and before locked
formula is usually n = x - w
therefore for Tim and Julie x=30, w=0, n=30-0 so 30, i=0
%passwd –x 30 –w 0 –n 30 i=0 tmiller
%passwd –x 30 –w 0 –n 30 i=0 jsmith
Bookkeeper/Accountant
Linda will have her own private group to keep all files confidential. However since
it’s a private group, you still need to give files group access.
%groupadd payroll
% adduser ljones
% newgrp payroll
Remember password must be at least 7 characters
% passwd ljones
% cd /home/ljones
% umask 007
% touch file
% ll
Make sure above only owner has rights
Password expiration
Linda’s password expires in 3 months and has 100 days after before lockup
W=7, x=90, n=90-7 83 i=100
% passwd –x 90 –w 7 –n 83 i 100 ljones
Linda cannot have access to a shell prompt. Therefore add a false shell to the
shells and direct her to use that.
% vi /etc/shells
Add at the end of the file “/bin/false”
% Esp :wq
% usermod –s /bin/false jsmith
% adduser wtang
% newgrp adm wtang
William will choose his own password so password expiration will be immediately
Operations
Erika has private files and can read Linda, Tim and Julies files. She will choose
her own password. Modify her username as its too long to esorensn
% groupadd oper
% adduser esorensn
% newgrp oper esorensn
Add her to Linda, Tim and Julie’s group too so that she has access to their files.
Password Expiration
Erika has access for 3 months and will choose her own password. Therefore
X=0 n-30 w=0 i=0
%passwd –x 0 –n 30 –i 0 –w 0 esorensn
At 3:00pm Tim’s account is to be given to James Smith add user jasmith since
jsmith is already in use
% adduser jasmith
% newgrp sysdev jasmith
% cp –r /home/tmiller /home/jasmith
% cd /home
% chown –R jasmith jasmith
Password James can choose other wise it will like Tim’s account
%passwd –x 30 –w 0 –n 0 i=0 jasmith