Installing a Linux distribution on a physical machine has become much easier than before. However, there are still some initial configurations that need to be done manually. I often forget the steps and command details, so I take detailed notes so that I don’t have to Google them multiple times.

Add sudo privilege to a user

In most Linux distros, the sudoers file should be located at /etc/sudoers, firstly we change to the root user,

1ls -al /etc/sudoers
2chmod 640 /etc/sudoers
3vim /etc/sudoers

locate to line root ALL=(ALL) ALL and add below

1user ALL=(ALL) ALL

then change back the file properties to

1chmod 440 /etc/sudoers

Do not change sudoers file to 777 as this would be unsafe.

Enable ssh connect to the server

Firstly, at the server side locate the sshd_config file /etc/ssh/sshd_config, locate item

1PubkeyAuthentication yes
2AuthorizedKeysFile .ssh/authorized_keys

to set it as yes. And the authorized keys should be at path .ssh/authorized_keys for each user, which should be manually created if there aren’t any. There is no need to allow remote login as root user in some case. Also I have disabled remote login through password authentication. Then, restart the sshd service,

1service sshd restart

for modern distros with compatibility, this command will be redirected to systemctl. Then generate a pair of rsa key at client side and upload the public key to the server side.

1ssh-keygen -t rsa -C "email_address"

You may discard the email_address for enhanced privacy.

Add new users

To add new users with a home/user folder, simply execute,

1useradd -m newuser

Then set up the password for the newly created user

1passwd newuser

List all users

To list all users, simply

1getent passwd

Enable Remote Desktop(RHEL 9 only)

Firstly, try to install epel-release directly through dnf,

1dnf install epel-release

If it did not work, then change to root user,

1su
2dnf update
3subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
4dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y

Then perform the first command in this section. Still with root user,

1dnf install xrdp
2systemctl start xrdp
3systemctl enable xrdp
4firewall-cmd --permanent --add-port=3389/tcp
5firewall-cmd --reload
6reboot

List hidden files

1ls -a

HPE servers’ iLO

iLO, or Integrated Lights-Out, is a proprietary embedded server management technology by Hewlett Packard Enterprise (HPE) that provides out-of-band management facilities. The physical connection is an Ethernet port that can be found on most ProLiant servers and microservers of the 300 and above series. iLO makes it possible to perform activities on an HP server from a remote location. The iLO card has a separate network connection (and its own IP address) to which one can connect via HTTPS. Possible options are:

  • Reset the server (in case the server doesn’t respond anymore via the network card)
  • Power-up the server (possible to do this from a remote location, even if the server is shut down)
  • Remote system console (in some cases however an ‘Advanced license’ may be required for some of the utilities to work)
  • Mount remote physical CD/DVD drive or image (virtual media), depends on license
  • Update the firmware and BIOS of the server
  • Monitor the server’s health and performance
  • Manage the server’s users and permissions

iLO can be accessed through a web browser, a command-line interface, or a mobile app. The web interface is the most user-friendly way to access iLO, but the command-line interface and mobile app offer more flexibility.

But how do you start with iLO only given a Cat 5 cable and a laptop with an RJ45? It would be much easier if we had a router or switch on hand so we could do DHCP. Well, connect the laptop and the iLO port with the Cat 5 cable. However, if we don’t know the IP address of the server in advance, it is not possible to log in to the management dashboard. The product tag comes with the default username and password, but there is no IP address as it is not fixed.

Simply download a port scanner and the IP address will be identified!