User Tools

Site Tools


linux:rhel

Linux - Red Hat

Linux CentOS 6.5

  • To check what package to install:
    yum whatprovides "*/scp"
  • GB = 1,000 Megabytes
  • GiB = 1,024 Megabytes
  • /var = install location
  • /home = user's home directories
  • / = root file system, 10 GiB
  • swap = temp files, 1 GiB
  • Install SNMP Utils
    yum install -y net-snmp.x86_64 
    yum install -y net-snmp-utils.x86_64

Enable SSH

chkconfig sshd on

Start SSH Service

service sshd restart

Add new user

useradd tst
passwd tst
password123
password123

Allow user root permissions

visudo
  1. Search for line that says ##Allow root to run any commands anywhere
  2. Copy root line and change username

Allow user sudo permissions

  1. For this, add a user to a group called wheel
usermod -aG wheel tst
  1. Modify visudo to enable wheel group
visudo
  1. Change line
## Allows people in group wheel to run all commands
# %wheel  ALL=(ALL)  ALL
  1. Delete the comment in front to %wheel and the new line will look like
%wheel  ALL=(ALL)  ALL

Linux RHEL 6.5

  • Register with Red Hat Subscription Manager
subscription-manager register
Username: 
Password: 
The system has been registered with ID: XXXXX

Linux CentOS 7

  • 802.1X Authentication Tutorial
  • Index all files
updatedb
  • Change laptop lid closing behavior
nano /etc/systemd/logind.conf
  • Change HandleLidSwitch to:
    • lock to lock the screen
    • ignore to do nothing
    • poweroff to power off the pc
  • Preserve the settings upon reboot
systemctl restart systemd-logind.service

Red Hat Linux 7.3

  • GB = 1,000 Megabytes
  • GiB = 1,024 Megabytes
  • /var = install location
  • /home = user's home directories
  • / = root file system, 10 GiB
  • swap = temp files, 1 GiB
  • <CTRL> + <l> (L) to wipe screen
  • mandb
    • man -k user
      • (List man pages with text 'user')
    • man -k user | wc (word count)
      • lines, words, characters
    • man -k user | grep 8
    • man -k user | grep 8 | grep create
  • Start vim→Command Mode→Insert mode
    • press 'a', 'i', 'o', or <INS> to go from Command Mode to Insert Mode
    • rest of commands are like vi
    • modes:
      • i = insert
      • o = open new line
      • a = add
      • <ESC> = go back to Command Mode
      • :wq = write, quit
      • ZZ = write, quit
    • Editing
      • dd = remove a line (cut)
      • yy = copy a link (copy)
      • dd and yy are written to a buffer
      • p = paste from buffer (paste)
    • Managing
      • u = undo
      • <CTRL> + <r> = redo
      • v + arrow keys = select characters
      • :q! = quit without saving
    • Useful
      • :%s/old/new/g = look for text 'old' and replace with 'new'
        • %s = substitue
        • g = replace with
      • G = goto end of document

Linux CentOS 8

linux/rhel.txt · Last modified: 2022/10/22 20:01 by Derg Enterprises