Why the adduser command does not request by default the User's name and password?

Hello

When the adduser command is executed in Ubuntu, it allows put data such as obviously the user’s name and password. But in Fedora Workstation 39 only is created the user based on the login name with its respective /home/<username> directory.

I mean if the sudo adduser leonardojordan command is executed then it creates the /home/leonardo directory and nothing more, is not possible define the name as Leonardo Jordan and put once the password.

Why this difference? What could be the official rest of steps to put a custom name and define the password? and even more data such as the “room” and “phone” fields that appear through Ubuntu.

Or I should use other command specific for Fedora to accomplish all these settings together such as the adduser command does at Ubuntu ?

Thanks for your understanding

Fedora’s approach:

  • Fedora uses separate commands for better modularity:
    useradd : Creates the user account and home directory based on the username provided.
    sudo useradd leonardojordan
    passwd : Sets the password for the newly created user
    sudo passwd leonardojordan

If you were in an enterprise environment,

sudo usermod -c "Leonardo Jordan (Room: 123, Phone: 555-1234)" leonardojordan


There is also some other options :

Set the user’s full name: You can use the chfn command to set the user’s full name interactively.

sudo chfn leonardojordan

This command will prompt you to enter the user’s full name, room number, phone number, etc.

2 Likes

Since you are on workstation which uses gnome you can also add the user thru the settings panel which allows putting in more information when a user is added.

1 Like