Linux 02 Difference between useradd and adduser

Описание к видео Linux 02 Difference between useradd and adduser

In the previous video I created an user using adduser command. To create an user I can use useradd command, too. What are the differences between this two commands?.

First, looking at the file containing all the users, I can see some differences between user david created with adduser in the previous video and the user rose created with useradd. At the end of the line bash shell is associated to user david. No shell is associated to user rose.

Another difference is that adduser command creates a HOME directory for the user.

Looking at the password file, we can see that there's an exclamation for the user rose. This exclamation means that no password has been set. The user cannot login to the system.

useradd is a binary program. We can't undestand its contents. If we print the contents of useradd we get a lot of strange symbols without any meaning to us.

adduser is an script and we can view and understand its contents. If you search inside the script, you can find calls to useradd command. adduser is sending the data entered by the user to useradd. useradd creates the user with the received information.

Комментарии

Информация по комментариям в разработке