Docsity

Network security basics, Slides of Computer Security

Partial preview of the text

Download Network security basics and more Slides Computer Security in PDF only on Docsity!

Linux Security Basics

Outline

Users and groups

  • (^) Permissions and access control
  • (^) Running commands with privilege
  • (^) Authentication

Users

In Linux, each user is assigned a unique user ID

  • (^) User ID is stored in /etc/password
  • Find user ID

Add Users & Switch to Other Users

Add users

  • (^) Directly add to /etc/password
  • (^) Use “adduser” command
  • (^) Switch to another user

Which Group Does a User Belong To?

Group Management

How to add users

Traditional Permission Model

  • Types of access on files - read (r) : user can view the contents of the file - write (w) : user can change the contents of the file - execute (x) : user can execute or run the file if it is a program or script
  • Types of access on directories - read (r) : user can list the contents of the directory (e.g., using ls) - write (w) : user can create files and sub-directories inside the directory - execute (x) : user can enter that directory (e.g., using cd)

File Permissions

Examples (umask)

Access Control List

Fine grained ACL

  • (^) Assign permissions to individual users/groups
  • (^) Coexist with the traditional permission model
  • (^) Example

RUNNING COMMAND WITH

PRIVILEGE

Why

  • (^) Three command mechanisms
    • (^) sudo
    • (^) Set-uid programs (covered in a separate chapter)
    • (^) POSIX capabilities

Getting Root Shell

In Ubuntu 20.04, the root user account is locked

  • (^) Cannot log into the root account
  • (^) There are many ways to get a root shell
    • (^) sudo –s
    • (^) sudo bash
    • (^) sudo su
  • It is not recommended to run commands using a root shell. Instead, use sudo to run individual commands.

Running Command Using Another

User

Run command using another user (instead of root, default)