User creation in Linux

1. To create a new user in zabbix.

useradd user_name

useradd -m user_name  #Using the -m option with useradd to create a home directory for new user

2. To set the password.

passwd user_name

3. To see the entry of the user.

vi /etc/passwd

Note: username:password:UID:GID:comment:home_directory:shell

shell: /usr/sbin/nologin
  • The login shell for the user. The /usr/sbin/nologin shell is used to prevent the user from logging into the system interactively. It is typically used for system or service accounts that do not require interactive login capabilities.

4. We can see the entry of the user.

cat /etc/passwd | grep user_name

Output: newusername:x:1001:1001::/home/newusername:/bin/bash

where /bin/bash indicates when a user logs in, the system starts this shell for the user, allowing them to interact with the system through Bash.

4. To see the password of all users in hashed form.

vi /etc/shadow

5. To find out which user you are currently working as in a Linux environment.

whoami

6. To provide detailed information about the current user.

id

7. To switch back to the root user from any other user account in a Linux environment.

su -

You will be prompted to enter the root password.



Comments

Popular posts from this blog

How to enable the syslog monitoring-Zabbix

Zabbix installation: Distribution setup

API & API in Zabbix