In this example I had a need to record boot up times in a file that i could access easily. To do so I decided to run a command on startup. This tutorial tool place on CentOS but the commands should also work on Ubuntu.
Edit the rc.local file in vi by running:
sudo vi /etc/rc.local
Add the following line to the file, update the home directory to represent your home directory.
Press i to go into insert mode
Enter the line:
echo “the computer booted up at” `date` >> /home/darren/bootup.log
Press ESC and then wq! and enter to save and quit the file.
Give the executable permission to the rc.local file by running the following command:
chmod +x /etc/rc.d/rc.local
Reboot the system by running:
sudo init 6
When the machine reboots run the following command to insure the file has been created and that there is content in the file:
In this tutorial I will show you how to RDP into your CentOS 7 Server. This tutorial will also work on a Redhat 7 server. In order to follow this tutorial you will need to be sure that you have CentOS 7 installed with the GNOME Desktop. If you haven’t done this yet be sure to follow this tutorial to get up to speed.
The first thing that we need to do is to add two repos to our CentOS server. The two commands that you need to run are:
This tutorial will show you how to reset the root password on CentOs 7 / Redhat 7. As a health warning please be sure that when doing this you have taken a snapshot of your VM or if it’s a physical server that you follow the instructions very carefully. With that in mind lets get started.
When the system boots up press e on this screen.
In the screen that appears scroll down to the line were you see Linux 16
Now Change where its says ro to:
Then press ctrl + x
You will now be in emergency mode which will look like the screen below:
Type in the command:
Reset the root password by typing in:
No ensure that selinux will be relabelled by typing the command:
This video shows how to log into a CentOs 7 server from a Windows machine using SSH keys. The video will show you how to generate the keys using Putty and then how to configure your CentOS 7 Server to allow you to authenticate into the server.
Putty is available to download from www.putty.org.
The commands that you need to follow along with the tutorial are: