Introduction to Linux
Linux is an operating system that works just like Windows and Mac OS X. As an operating system, Linux is a very hands-on operating system. If running Windows is like driving an automatic, then running Linux is like driving a stick. It can take some work, but once you know your way around Linux, you’ll be using the command line and installing packages like a pro.
Note
Everything on a Linux system is case-sensitive. That means that photo.jpg, photo.JPG, and Photo.jpg are all different files. Usernames and passwords are also case-sensitive.
We’ll mostly be using the terms terminal, shell, and SSH to refer to the interface you use to send text commands to your Linux system. These are different tools that layer on top of each other to let you interact with your server. To learn more, read these simplified definitions:
- Terminal: A device that enters data into and displays data from a computer. The terminal has the most direct access to the operating system. Technically, most terminals these days are actually terminal emulators that run as software on Mac OS X, Linux, or Windows computers.
- Shell: A program that provides a user interface for interacting with an operating system. There are different types of shells, but the one we’re using here is called Bash and provides a command-line interface that accepts and outputs text.
- SSH: A protocol that lets you send shell commands to your Linode securely over the Internet.
Linux Directory Structure:-
The Shell
In a Linux system, the shell is a command-line interface that interprets a user's commands and script files, and tells the server's operating system what to do with them. There are several shells that are widely used, such as Bourne shell (
sh
) and C shell (csh
). Each shell has its own feature set and intricacies, regarding how commands are interpreted, but they all feature input and output redirection, variables, and condition-testing, among other things.
This tutorial was written using the Bourne-Again shell, usually referred to as
bash
, which is the default shell for most Linux distributions, including Ubuntu, CentOS, and RedHat.
/etc/passwd file in Linux Explained with Examples
Learning the /etc/passwd file is the essential requirement of Linux user management. Learn why /etc/passwd file is used, what is stored in it and how it is formatted in detail with examples.
The /etc/passwd file is stored in /etc directory. To view it, we can use any regular file viewer command such as cat, less, more, etc.
Each line in /etc/passwd file represents an individual user account and contains following seven fields separated by colons (:).
- Username or login name
- Encrypted password
- User ID
- Group ID
- User description
- User’s home directory
- User’s login shell
/etc/shadow file in Linux Explained with Examples
Historically, the /etc/passwd file used to store all login information in a standalone Linux system. Later, due to following reasons password information was moved in /etc/shadow file.
· The /etc/passwd file has only one field for password information. Since there is only one field, besides encrypted password other password related information cannot be stored in this file.
· For password encryption, the /etc/passwd file supports basic algorithm such as DES. A hacker can easily reveal a password encrypted with DES algorithm.
· The /etc/passwd file is world readable. It means any local user can view the passwords stored in this file.
· The /etc/shadow file addresses all above issues.
· The /etc/shadow file has nine fields to store encrypted password and other password related information.
· The /etc/shadow file supports all advanced algorithms and has plenty of room for further updates.
· The /etc/shadow file is readable only by root user.
Each line in /etc/shadow file represents an individual user account and contains following nine fields separated by colons (:).
- Username
- Encrypted password
- Date of last password change
- Minimum required days between password changes
- Maximum allowed days between password changes
- Number of days in advance to display password expiration message
- Number of days after password expiration to disable the account
- Account expiration date
- Reserve field
To be continued.... we'll update soon.
No comments:
Post a Comment