Posts

How to setup SSH Key-Based Authentication (Private & Public keys)

What is SSH ? SSH – secure shell is a protocol that helps systems to in an secure & encrypted manner over an network Using SSH, we can create a secure connection to the remote server using a specific user account & get the shell session on the remote server as that user & can perform tasks   NOTE: In order to login to the remote server, we need sshd service running in the remote server   How to setup SSH Key-Based Authentication ? There are few advantages of using SSH Key-Based Authentication • Getting access to the system by password guessing techniques is defeated • With passphrase-protected private keys, Both the passphrase and a copy of the private key is needed.   This is based on private-public key mechanism A private key, a matching public key is needed for this The private key acts like a password, which must be preserved securely, Public key is copied to the system the user wants to access When try to access the remote ...

How services works in Linux

Image
Daemons are processes that run in background that perform specific tasks, that start automatically at boot time and runs till the system shutdown or stopped manually. Daemon program names ends with d Systemd is the first program that starts and following which multiple services starts including dependent services For Example, Services that require network services wont start until network is available   Some useful Commands ·          Systemctl – you will see UNIT , LOAD, ACTIVE, SUB, DESCRIPTION column . Sample output attached below   systemctl list-units --type=[service, scope, mount, socket]   To list the dependancy of the service ·          systemctl list-dependencies <service> To check the status of the service ·          systemctl status <service> To verify the status of the service ·    ...

Permissions in Linux

Image
  Every file or directory has 2 owners: User Group Others (Who is this ? - Other  is everyone that is not the owner or in the group. )   When a user creates a file he becomes owner of the file, a group he belongs become group owner if user is the owner of the file, he gets the access if user is the member of the group to which file permission is granted, he gets the access if he is not part of user or group, he get the permissions of others Important commands:   ls -l – longlisting of files   To list all files with a given user or group Find / -user <name> Find / -group <name>     Changing user ownership Chown who what Chown -R who what -  Here R represent recursively Changing group ownership Chgrp Newgrp To change primary group Gpasswd setting group password Note: Linux does not know inheritance   Permissions      There are 3 basic permissions:   Read Write Exec...

User Management in Linux

There are 2 type of users in Linux  1.  Privileged  users -  by default a root users 2.  Unprivileged  users -  normal or system users Normal user or system user no big difference : normal user is a regular user account & system user is also a regular account but used for specific purpose i.e daemons, running a application Root user is also referred as superuser , this account has all privileges in system, so need to be cautious when using this account as we can cause damage to the system What all we can do with root ? 1. installing software 2. managing users 3. partition creations ( Note : with Normal user you can manage removable drives) NOTE: It is recommended that we login to the system with normal user account and switch to superuser account when needed Some useful commands: id <useraccount> - Eg: id user01 useradd -m <username> - creating a user (-m option creates the home directory for the user) passwd <username> - setti...