Basic Linux

Different between Linux and UNIX?

No alt text provided for this image

Linux Architecture

No alt text provided for this image

How many types of Shells are there in Linux?

  • Bourne Shell (sh)?
  • C Shell (csh)?
  • Korn Shell (ksh)?.
  • Bourne Again Shell (bash)?– default
  • Z Shell (zsh)

Linux Directory structure

  • / (root filesystem):?It is the top-level filesystem directory. It must include every file needed to boot the Linux system before another filesystem is mounted. /boot:?It includes the static kernel and bootloader configuration and executable files needed to start a Linux computer.
  • /bin:?This directory includes user executable files.
  • /dev:?It includes the device file for all hardware devices connected to the system.
  • /etc:?It includes the local system configuration files for the host system.
  • /lib:?It includes shared library files that are needed to start the system.
  • /home:?The home directory storage is available for user files. All users have a subdirectory inside /home.
  • /mnt:?It is a temporary mount point for basic filesystems that can be used at the time when the administrator is working or repairing a filesystem.
  • /media:?A place for mounting external removable media devices like USB thumb drives that might be linked to the host.
  • /opt:?It contains optional files like vendor supplied application programs that must be placed here.
  • /root:?It's the home directory for a root user. Keep in mind that it's not the '/' (root) file system.
  • /tmp:?It is a temporary directory used by the OS and several programs for storing temporary files.
  • /sbin:?These are system binary files. They are executables utilized for system administration.
  • /usr:?They are read-only and shareable files, including executable libraries and binaries, man files, and several documentation types.
  • /var:?Here, variable data files are saved. It can contain things such as MySQL, log files, other database files, email inboxes, web server data files, and much more.

File Permissions:

All the three owners (user owner, group, others) in the Linux system have three types of permissions defined. Read(r), Write (w), Execute(x)

$ ls -l drwxr-xr-x. 4 root root 68 Jun 13 20:25 tuned        

  • File type:?-
  • Permission settings:?rw-r--r--
  • Extended attributes: dot (.)
  • User owner:?root
  • Group owner:?root
  • r (read): 4
  • w (write): 2
  • x (execute): 1

Default file permission is 644 and directory 755?

What is SSH ? How you generate SSH-keys

SSH (Secure Shell) is a cryptographic network protocol used for secure remote access and secure file transfer over an insecure network. It provides a secure channel between two systems, allowing secure authentication and encrypted communication.

SSH uses public-key cryptography to authenticate and establish a secure connection. Here's a general process for generating SSH keys:

Open a terminal or command prompt on your local system.

Use the ssh-keygen command to generate the SSH key pair. By default, this command generates a 2048-bit RSA key pair. You can specify a different key type (e.g., ED25519) and key size if desired. For example:

ssh-keygen -t rsa -b 2048

The command will prompt you to choose a location to save the generated keys. Press Enter to accept the default location (~/.ssh/id_rsa) or provide a custom path.

Next, you'll be prompted to enter a passphrase for the key pair. A passphrase adds an extra layer of security by encrypting the private key with a password. You can choose to use a passphrase or leave it empty for a passphrase-less key. It is generally recommended to use a passphrase.

The ssh-keygen command will generate two files: a private key file (typically named id_rsa) and a public key file (typically named id_rsa.pub).

The private key (id_rsa) must be kept secure and should not be shared with anyone. It is used for authentication when connecting to remote systems.

The public key (id_rsa.pub) can be shared with remote systems to which you want to authenticate. It is added to the ~/.ssh/authorized_keys file on the remote system.

To use the generated SSH key pair, you can either manually copy the public key to the remote system or use the ssh-copy-id command. For example:

ssh-copy-id user@remote_host

Difference between IPv4 & IPv6

IPv4 (Internet Protocol version 4) and IPv6 (Internet Protocol version 6) are two different versions of the Internet Protocol that are used to identify and communicate with devices on a network. Here are the key differences between IPv4 and IPv6:

Address Length: IPv4 addresses are 32 bits in length and expressed in four sets of decimal numbers (e.g., 192.168.0.1). This provides approximately 4.3 billion unique addresses. In contrast, IPv6 addresses are 128 bits in length and expressed in eight sets of hexadecimal numbers separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).

In summary, IPv4 and IPv6 differ in terms of address length, addressing and routing mechanisms, header format, address types, support for additional features, and deployment status.

Important commands

No alt text provided for this image


要查看或添加评论,请登录

Sagar Kulkarni的更多文章

  • GIT: Source code management

    GIT: Source code management

    Source code management (SCM) is the practice of tracking and controlling changes to source code throughout the software…

    1 条评论
  • Essential-kubernetes-concepts

    Essential-kubernetes-concepts

    Kubernetes Architecture Kubernetes vs AWS EKS Architecture Local Kubernetes local Cluster options - Minikube - Kind -…

社区洞察

其他会员也浏览了