SlideShare a Scribd company logo
1 of 2
Laboratorijas darbs 4

Lietotāju un grupu kontu veidošana
Lietotāju kontu veidošana
   Izveidot lietotāja kontu 'user01' ar “Users and Groups” rīka palīdzību:
   Izvēlēties “System”> “Administration”>”Users and Groups”. Iepazīties ar esošajiem
lietotājiem un grupām un viņu parametriem
   Izveidot jaunu lietotāju 'user01', nospiežot izvēlni “Add user” un ievadot sekojošu
informāciju:
• Username: user01
• Real name: Testa lietotajs
   Izvēlēties paroli un ievadīt to divas reizes uzrādītajās vietās.
   Pārējās sadaļās iepazīties ar pārējiem iespējamajiem uzstādījumiem
   Apstiprināt lietotāju ar “Ok”
   “Users and groups” dialoga logā pārbaudīt uzstādītos konta parametrus.
   Iepazīties ar komandām 'useradd', 'passwd' un 'usermod' sintaksi ar iebūvētā palīdzības un
rokasgrāmatu palīdzību, t.i.:
      useradd ­­help
      man useradd
  Izveidot lietotāja kontu 'user02' ar komandrindas palīdzību
      sudo useradd user02
  Salīdzināt izveidotos lietotāju kontus ar “Users and Groups” rīku. Kas atšķiras?
  Salīdzināt izveidoto kontu ierakstus failos /etc/passwd un /etc/shadow, piemēram, ar
komandu
      sudo cat /etc/passwd /etc/shadow | grep user0
   Kas atšķiras kontu ierakstos?
   Pārskatīt direktoriju /home un pārliecināties, ka ir izveidotas mājas direktorijas jaunajiem
lietotājiem:
      ls ­l /home
  Pievienot lietotājam user02 čaulu un mājas direktoriju
      usermod ­­help
      sudo usermod ­s /bin/bash ­d /home/user02  ­c "Testa lietotajs2" user02
      sudo mkdir /home/user02
      sudo chown user02 /home/user02 
  Ko nozīmē augstākminētās komandas?
  Konsoles režīmā ar root lietotāja kontu pārslēgties uz jaunajiem lietotāju kontiem un iziet
no tiem ('X' vietā lietot '1' vai '2'):
      sudo su – user0X
      id
      pwd 
      exit
  Vai bija iespējams to izdarīt? Kurā direktorijā nonāk lietotājs pēc noklusējuma (tekošo
direktoriju uzrāda komanda `pwd`)?
  Izlogoties no sistēmas un izmēģināt, vai var pieteikties sistēmā ar jaunizveidotajiem
kontiem. Kāpēc nevar ielogoties ar lietotāju “user02”?
  Ielogoties ar oriģinālo sistēmas lietotāju un pārskatīt pēdējos autentifikācijas ierakstus ar
komandu
      tail /var/log/auth.log
   Piešķirt paroli lietotājam user02 ar “Users and Groups” palīdzību. Pārbaudīt, vai tagad var
ielogoties sistēmā arī ar lietotāju “user02”.

Laboratorijas darbs 4 – Lietotāji un grupas                                              1.lpp
Salīdzināt lietotāju kontu ierakstus failā /etc/shadow. Kas mainījies?
  Ar useradd izveidot jaunu lietotāju “user03”, piešķirt lietotājam paroli ar komandu `sudo
passwd user03`, un pārbaudīt, vai:
• var pārslēgties uz jaunizveidoto lietotāju ar su komandu
• ar jaunizveidoto lietotāju var pieteikties sistēmā.
  Piešķirt lietotājam “user03” komentāra lauku (Lietotāja vārdu uzvārdu)
      sudo usermod ­c 'Vards Uzvards' user03
  Pārskatot failu /etc/passwd pārbaudīt, vai šis vārds tiešām piešķirts.
  Bloķēt lietotāja kontu user03 ar komandu
      sudo usermod ­L user03
   Pārbaudīt, vai ar komandu 'su' (switch user) var pārslēgties uz lietotāju user03, un vai var
sistēmā iežurnalēties ar šo lietotāja kontu.
   Pārskatīt lietotāja paroli failā /etc/shadow un pārbaudīt, vai parolei priekšā pievienota
izsaukuma zīme.
   Atbloķēt lietotāja kontu user03 ar komandu
      usermod ­U user03
  Pārbaudīt, vai var iežurnalēties ar šo kontu sistēmā un pārskatīt izmaiņas failā /etc/shadow.

Konta derīguma termiņa maiņa
 Uzstādīt, ka lietotājam user03 parole jāmaina ik pēc 30 dienām, brīdinājumus par paroles
maiņu ir 5 dienas pirms maiņas termiņa beigām
      passwd ­x 30 ­w 5 ­i 15 user03
  Pārbaudīt izveidotos uzstādījumus, pārskatot /etc/shadow failu.
  Uzstādīt lietotājam user02 pazīmi, ka viņa konts beigsies 2009. gada 1. decembrī
      usermod ­e 2009­12­01 user02
  Pārbaudīt izveidotos uzstādījumus pārskatot /etc/shadow failu.

Grupas konti
  Izveidot jaunu grupu “group0”
      sudo groupadd group0
  Pievienot lietotājus user01, user02, user03 jaunajai grupai:
      sudo usermod ­G group0 user01
      sudo usermod ­G group0 user02
      sudo usermod ­G group0 user03
   Pārskatot kontus ar “Users and Groups” un pārskatot failu /etc/group, pārliecināties, vai
lietotāji ir pievienoti grupā.
   Izveidot jaunu resursu, ar kuru pārbaudīt, vai lietotāji var izmantot grupas tiesības, un
nomainīt tiesības tā, lai tikai root lietotājam un grupai būtu lasīšanas tiesības.
      ps ax > /tmp/test.txt
      chmod ­v 640 /tmp/test.txt
      ls ­l /tmp/test.txt
  Nomainīt resursa grupas ierakstu
      sudo chown :group0 /tmp/test.txt
      ls ­l /tmp/test.txt
  Pārslēgties uz lietotāju user01 un pārbaudīt, vai var lasīt faila saturu:
      sudo su user01
      cat /tmp/test.txt
      exit
  Izņemt lietotāju user01 no grupas group0 ar komandu `sudo usermod -G '' user01` un
vēlreiz pārbaudīt, vai ar šo lietotāju var lasīt faila saturu.



Laboratorijas darbs 4 – Lietotāji un grupas                                              2.lpp

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Ld 05 lietotaji

  • 1. Laboratorijas darbs 4 Lietotāju un grupu kontu veidošana Lietotāju kontu veidošana Izveidot lietotāja kontu 'user01' ar “Users and Groups” rīka palīdzību: Izvēlēties “System”> “Administration”>”Users and Groups”. Iepazīties ar esošajiem lietotājiem un grupām un viņu parametriem Izveidot jaunu lietotāju 'user01', nospiežot izvēlni “Add user” un ievadot sekojošu informāciju: • Username: user01 • Real name: Testa lietotajs Izvēlēties paroli un ievadīt to divas reizes uzrādītajās vietās. Pārējās sadaļās iepazīties ar pārējiem iespējamajiem uzstādījumiem Apstiprināt lietotāju ar “Ok” “Users and groups” dialoga logā pārbaudīt uzstādītos konta parametrus. Iepazīties ar komandām 'useradd', 'passwd' un 'usermod' sintaksi ar iebūvētā palīdzības un rokasgrāmatu palīdzību, t.i.: useradd ­­help man useradd Izveidot lietotāja kontu 'user02' ar komandrindas palīdzību sudo useradd user02 Salīdzināt izveidotos lietotāju kontus ar “Users and Groups” rīku. Kas atšķiras? Salīdzināt izveidoto kontu ierakstus failos /etc/passwd un /etc/shadow, piemēram, ar komandu sudo cat /etc/passwd /etc/shadow | grep user0 Kas atšķiras kontu ierakstos? Pārskatīt direktoriju /home un pārliecināties, ka ir izveidotas mājas direktorijas jaunajiem lietotājiem: ls ­l /home Pievienot lietotājam user02 čaulu un mājas direktoriju usermod ­­help sudo usermod ­s /bin/bash ­d /home/user02  ­c "Testa lietotajs2" user02 sudo mkdir /home/user02 sudo chown user02 /home/user02  Ko nozīmē augstākminētās komandas? Konsoles režīmā ar root lietotāja kontu pārslēgties uz jaunajiem lietotāju kontiem un iziet no tiem ('X' vietā lietot '1' vai '2'): sudo su – user0X id pwd  exit Vai bija iespējams to izdarīt? Kurā direktorijā nonāk lietotājs pēc noklusējuma (tekošo direktoriju uzrāda komanda `pwd`)? Izlogoties no sistēmas un izmēģināt, vai var pieteikties sistēmā ar jaunizveidotajiem kontiem. Kāpēc nevar ielogoties ar lietotāju “user02”? Ielogoties ar oriģinālo sistēmas lietotāju un pārskatīt pēdējos autentifikācijas ierakstus ar komandu tail /var/log/auth.log Piešķirt paroli lietotājam user02 ar “Users and Groups” palīdzību. Pārbaudīt, vai tagad var ielogoties sistēmā arī ar lietotāju “user02”. Laboratorijas darbs 4 – Lietotāji un grupas 1.lpp
  • 2. Salīdzināt lietotāju kontu ierakstus failā /etc/shadow. Kas mainījies? Ar useradd izveidot jaunu lietotāju “user03”, piešķirt lietotājam paroli ar komandu `sudo passwd user03`, un pārbaudīt, vai: • var pārslēgties uz jaunizveidoto lietotāju ar su komandu • ar jaunizveidoto lietotāju var pieteikties sistēmā. Piešķirt lietotājam “user03” komentāra lauku (Lietotāja vārdu uzvārdu) sudo usermod ­c 'Vards Uzvards' user03 Pārskatot failu /etc/passwd pārbaudīt, vai šis vārds tiešām piešķirts. Bloķēt lietotāja kontu user03 ar komandu sudo usermod ­L user03 Pārbaudīt, vai ar komandu 'su' (switch user) var pārslēgties uz lietotāju user03, un vai var sistēmā iežurnalēties ar šo lietotāja kontu. Pārskatīt lietotāja paroli failā /etc/shadow un pārbaudīt, vai parolei priekšā pievienota izsaukuma zīme. Atbloķēt lietotāja kontu user03 ar komandu usermod ­U user03 Pārbaudīt, vai var iežurnalēties ar šo kontu sistēmā un pārskatīt izmaiņas failā /etc/shadow. Konta derīguma termiņa maiņa Uzstādīt, ka lietotājam user03 parole jāmaina ik pēc 30 dienām, brīdinājumus par paroles maiņu ir 5 dienas pirms maiņas termiņa beigām passwd ­x 30 ­w 5 ­i 15 user03 Pārbaudīt izveidotos uzstādījumus, pārskatot /etc/shadow failu. Uzstādīt lietotājam user02 pazīmi, ka viņa konts beigsies 2009. gada 1. decembrī usermod ­e 2009­12­01 user02 Pārbaudīt izveidotos uzstādījumus pārskatot /etc/shadow failu. Grupas konti Izveidot jaunu grupu “group0” sudo groupadd group0 Pievienot lietotājus user01, user02, user03 jaunajai grupai: sudo usermod ­G group0 user01 sudo usermod ­G group0 user02 sudo usermod ­G group0 user03 Pārskatot kontus ar “Users and Groups” un pārskatot failu /etc/group, pārliecināties, vai lietotāji ir pievienoti grupā. Izveidot jaunu resursu, ar kuru pārbaudīt, vai lietotāji var izmantot grupas tiesības, un nomainīt tiesības tā, lai tikai root lietotājam un grupai būtu lasīšanas tiesības. ps ax > /tmp/test.txt chmod ­v 640 /tmp/test.txt ls ­l /tmp/test.txt Nomainīt resursa grupas ierakstu sudo chown :group0 /tmp/test.txt ls ­l /tmp/test.txt Pārslēgties uz lietotāju user01 un pārbaudīt, vai var lasīt faila saturu: sudo su user01 cat /tmp/test.txt exit Izņemt lietotāju user01 no grupas group0 ar komandu `sudo usermod -G '' user01` un vēlreiz pārbaudīt, vai ar šo lietotāju var lasīt faila saturu. Laboratorijas darbs 4 – Lietotāji un grupas 2.lpp