Skip to main content

Command Palette

Search for a command to run...

Week 2: Linux System Administration & Automation

Task 1 : By Shubham Londhe #90daysofdevops

Updated
1 min read

1. Create a user devops_user and add them to a group devops_team

Create a group

Command:

sudo groupadd devops_team

Create a user and assign them to the group

sudo useradd -m -G devops_team devops_user

2. Set a password and grant sudo access.

Command:

sudo passwd devops_user

Grant sudo access to the user

Command:

sudo usermod -aG sudo devops_user

3.Restrict SSH login for certain users in /etc/ssh/sshd_config.

  1. Edit the SSH configuration file:

command:

sudo nano /etc/ssh/sshd_config

  1. Add or modify the following lines:
  • To allow specific users:

    Command:

    AllowUsers devops_User

  • Or, to deny specific users:

    Command:

    DenyUsers <username>

    1. Save the changes
  • Press CTRL + O to save the file.

  • Press CTRL + X to exit the Nano editor.

    4.Restart the SSH service

    To apply the changes, restart the SSH service using this command:

sudo systemctl restart ssh
/


  • Task 2 : BY Shubham Londhe

File & Directory Permissions

Task:

    • Create /devops_workspace and a file project_notes.txt.

      • Set permissions:

        • Owner can edit, group can read, others have no access.
      • Use ls -l to verify permissions.

Command:

  • mkdir /devops_workspace

  • touch /devops_workspace/project_notes.txt

  • chmod 740 /devops_workspace/project_notes.txt

  • ls -l