How do I add a new OS user in Linux?

Add a user from the command line

View a step-by-step screencast of this process:

As with every command entered when performing system administration tasks from a command line, syntax is important. Please make sure that every character is entered exactly as shown below. To avoid common syntactical mistakes, we recommend you copy and paste the entire example commands into a text editor, make the necessary changes, and then paste the resulting commands into your terminal session.
  • NOTE: in the example below, we are adding a user with the username “johndoe.” Replace “johndoe” with the username you wish to add to the system.
  • Log into your server as root
  • Create a new user that’s a member of the “eclipse” user group:
useradd -G eclipse johndoe
  • Set the user’s Linux login password:
passwd johndoe
  • NOTE: if you attempt to set a weak password, you may see a warning. If you are willing to accept using a weak password, simply type it in again and confirm to proceed. If you would like to create a user with a blank password, please see this article.
  • Create a link for the user’s profile, which will automatically launch Eclipse when they login:
Important: please verify that the order of arguments in the command is correct: /u2/eclipse/.profile must come first, followed by a space, and then the new user’s profile directory.
Important: please note there is a space between the source and destination locations.
ln -sf /u2/eclipse/.profile /home/johndoe/.bash_profile
  • Open Eterm and log into the server using the newly created username and password. If you added the user correctly,  you will be presented with the blue Eclipse login screen.
  • If you are presented with a prompt to update the directory’s VOC, modify the /u2/eclipse/.profile file as root, adding the following block of code before the “Setup the Eclipse environment” section:
# Move to the Eclipse account home directory
export ECLIPSEHOME=/u2/eclipse
cd $ECLIPSEHOME
  • If you’re still not able to log in using the new user’s credentials, please open a support request, and the Eclipse support team will provide assistance.

For step-by-step instructions with screenshots for using the graphical interface, see the official Red Hat documentation on Users and Groups

How to I remove an OS user from Linux?

Warning: As always, please exercise caution when performing system maintenance, especially when initiating processes that can potentially delete data.

Locking a User Account

In most cases, there is no reason to remove an OS user. It is better to simply lock down the account to prevent any future login.

Remove User

How do I find my Linux server’s IP address?

To find the LAN IP address, open a shell and run:

/sbin/ifconfig

Look for the inet addr in the output, which will look like below:

eth0      Link encap:Ethernet  HWaddr 00:22:19:84:9B:E8
          inet addr:192.168.1.89  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::222:19ff:fe84:9be8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8380921 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8360250 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:806377947 (769.0 MiB)  TX bytes:752649055 (717.7 MiB)
          Interrupt:169 Memory:f8000000-f8012100