Adding users to RHEL

From WolfTech
Jump to: navigation, search

You can add users to RHEL machines either by remote or while sitting in front of the machine. Everything in this document assumes that you have login and sudo access to the machine. If you don't, Brian, Dan, Micah, or Patrick can add users for you.

Connecting to the machine

  • Connecting remotely through Putty
  • Load up Putty and enter the FQDN of the machine in the "Host Name" blank and hit "Open". You don't need to change any other settings (unless you are using a version of Putty before v.055, in which case you need to click the SSH button under "Protocol"). If you get a prompt about adding (or changing) the RSA host key, say Yes.
  • Connecting remotely from another Unix machine
  • At a prompt, use the "ssh" command and the FQDN to connect to the machine. For example:
  ssh grendel.ece.ncsu.edu
  • Locally at the machine
  • Hit CTRL+ALT+F1 to enter a text interface. Log in as normal. CTRL+ALT+F7 will return to the graphical interface once you are done.

Changing to Root

Once you are logged into the machine, you must enter a root shell to be able to make the necessary changes. To do so, enter "sudo su -" at the prompt. You will be prompted to enter your unity password. If successful, you will then be acting as root.


MAKE ABSOLUTELY NO CHANGES BEYOND THE ONES THAT ARE DESCRIBED BELOW

Adding Users

  • As root, enter the following command:
  vi /etc/users.local.base
  • Hit the Insert key to start editing and add the necessary users to the list. Hit the ESC key to stop editing once you are finished.
  • To save the file, type in ":wq" and hit Enter to save the file and exit the editor.
  • If possible, reboot the machine, and the users will be able to log in after the reboot. If a reboot is not possible, you will need to edit /etc/users.local in order for the users to be able to log in. Edit it the same way you did users.local.base.
  • If you are finished, use the command "exit" to exit the root shell, then logout. If you need to give users sudo access, continue reading.

Adding Sudo Users

  • Any user you add to the sudo list must also be a member of the local user lists.
  • As root, enter the following command:
  visudo
  • Hit the Insert key to start editing and insert users in the following format:
  username ALL=(ALL) ALL
  • Important: In between the username and ALL there must be either a single space or a single tab.
  • Hit the ESC key to stop editing once your are finished. To save the file, type in ":wq" and hit Enter to save the file and exit the editor.
  • Use the command "exit" to exit the root shell, then logout.