i Linux Basic – part 3 – All things in moderation

Linux Basic – part 3

5. Users inside of Linux

Let’s talk about users inside of Linux. The users inside of Linux are stored inside the /etc/passwd file. So here is what the contents of the /etc/passwd file look like:

So, let’s try to understand what the sample entry means. The output for the first line look like this :

root:x:0:0:root:/root:/bin/bash
  • The “root” is the username.
  • The root is followed by x, which means that the passsword is moved inside the shadow file, which we will discuss next
  • Next is the UID of user, which (0) for root, followed by the groupid(0) primary group the user belongs to. In this case, the use belongs to root.
  • Next is the space for comments, which an administrator may want to store.
  • It is then followed by the absoulute path of the home directory, which is also the starting localtion of the command line.
More about the /etc/passwd file:
  • In a standard /etc/passwd file , most of the users would be default users like bin/adm and mail
  • All the Unix/Linux Users are identifed by a user id, which starts at 0 and increments from there with some jumps in between. Any user with uid 0 has root level privileges.
  • The nondefault users gernerally have UID starting from 500 or 1000, and increment from there.
  • Inside of the /etc/passwd file , some users would have /false at the end, which means theat thore users cannot have an interactive login session.
6. Linux Services

The tranditional Linux services are inside the /etc/init.d directory; this would include srcripts to execute a particular service or program that would begin when Linux starts loading.

7. Linux Password Storage

The password for Unix/Linux is stored inside the /etc/passwd file or /etc/shadow file. Modern Unix-based systems only store passwords in the /etc/shadow file and are only readable by root. In older Unix versions, you may find passwords being stored in the /etc/passwd file. This is what the /etc/shadow file looks like:

The username is followed by a hash. The hashing method would depend upon the version of Linux you are using. MD5 is the most common hashing format for Linux; the password is salted, making it very difficult to crack.

8. Linux logging

Now, let’s talk briefly about where the log files are stored. The log files are an are fo interest for hackers because they want to remove traces of their presence when they have compromised the servers.
Generally the logs are stored inside the /var/log and /var/adm diretory. Howerver, many services such as httpd have there own place for storgin logs. The Linux saves .bash_history inside of the /home directory. The .bash_directory file contains list of commands that were used from bash.

OK, That’s all Linux basic I want to share for you , In the next post we will explore more Linux kernel and Shell

Leave a Reply