Blog Archives

Awk Trick: Verify the /etc/passwd Lines

As you know, the /etc/passwd file has 7 fields on each line. The lines from /etc/passwd having more than 7 fields can create security vulnerabilities or generate massive system errors. It is better to remove them This little awk oneliner

Tagged with: , , , , , , , ,
Posted in The Linux and Unix Articles!

The Linux and Unix Nobody User

In Linux and Unix, the processes and services run under different users. The processes may have a user created specifically for them, and, if they do not, they will run under a user called nobody. E.g. sshd is the user

Tagged with: , , , , ,
Posted in The Linux and Unix Articles!

The Linux/Unix /etc/passwd file

The /etc/password file is very important on Unix systems because it stores information about all the user accounts in the system. It is readonly, the users can read the file, but not to modify it, unless they have superuser priviledges.

Tagged with: , , , ,
Posted in The Linux and Unix Articles!

How to safely edit /etc/passwd , /etc/shadow and /etc/group in Linux

Do not edit the /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow by hand !!! If a user tries to change it’s account / group info while root is editing the files by hand (ex: vim /etc/passwd), the /etc files will not pe

Tagged with: , , , , , , , , ,
Posted in The Linux and Unix Articles!

How to create users in Linux with the generical useradd command

The useradd command is generical for all the Linux distros: Syntax: useradd [options] username Creating users with the default configuration: $ sudo useradd yoda $ grep yoda /etc/passwd yoda:x:1010:1012::/home/yoda:/bin/sh To view the default options for creating users, use useradd -D

Tagged with: , , , ,
Posted in The Linux and Unix Articles!

The Linux cp command: with practical examples

In this tutorial, I will teach you how to copy files and folders from one place to another, by using the cp command. Syntax1: cp [options] file filecopy Syntax2: cp [options] -T filecopy fileĀ  I always use the first syntax

Tagged with: , , , , , , , ,
Posted in The Linux and Unix Articles!
Support LinuxG via Patreon
Support LinuxG.net on Patreon!
Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!