Solved: How to change the keyboard layout for Redhat Linux

Nowadays we work as global teams and with people speaking different languages.
Some times you may face a situation where the Linux OS is installed with preference to another language e.g. French.  The layout of french keyboard is different from that of US keyboard. Thus if you type  “A” in US keyboard it will actually print “Q” . (Here you can get images of french keyboard)
This can be very frustrating since you are already accustomed with the US keyboard layout.
To  get you out of this situation the easiest way is that once you login to the linux box. Run below command.
loadkeys us
This simple command will map the session with US keyboard layout. So now when you type “A” in your US layout keyboard it will be printed as “A” only. And this won’t change any langs in OS as it is mapped only to your session.
Do note that before you login you will still have to type userid and password in french layout only.  Command can obviously be executed only after you login. So the image link i shared above should be helpful in getting you through the login stage.
Hope this post helps you.

Solved: How to change hostname in AWS EC2 instance of RHEL 7

In our last post we have seen how to change hostname of an RHEL server.
But if you are using the RHEL 7 AMI provided on AWS marketplace the steps will be slightly different.
First login to your EC2 instance. (Check this post to know How to login to AWS EC2 Linux instance.)
Once you login to your EC2 instance execute below command.
 sudo hostnamectl set-hostname --static cloudvedas
(Here “cloudvedas” is the new hostname.)
If you want to make it persistent across reboot follow further.
Now using vi or vim editor edit the file /etc/cloud/cloud.cfg
sudo vi /etc/cloud/cloud.cfg
At the end of file add the following line and save the file
preserve_hostname: true
Finally reboot the server
sudo reboot
Once the server is up, check the hostname.
ec2-user# hostname
cloudvedas
ec2-user#
It should now show you the new hostname.

Solved: How to change hostname in Redhat Linux

In this post we will see how to change hostname in Redhat Linux 4, 5, 6 and 7 .
For changing the hostname you should have root access. To switch to root do:-
sudo su -
If you want to change the hostname temporarily do as below:-
hostname <new-hostname>
e.g.
hostname cloudvedas
But above change is not permanent and will change back to old name after reboot.
To make the change permanent you will have to make the entry in couple of files. If you are using RHEL 4,5,6 use the below steps, else directly go down to section for RHEL 7. If you don’t want to modify files manually refer this post to change hostname using nmtui or nmcli tools.
RedHat based system use the file /etc/sysconfig/network to read the saved hostname at system boot.
NETWORKING=yes
HOSTNAME=cloudvedas
Next you have to modify /etc/hosts file. Entry in hosts file should look like.
172.25.31.65 cloudvedas
RHEL 7
If you are having RHEL 7 you just have to execute one command which will take care of everything.
hostnamectl set-hostname --static cloudvedas
The above steps will make the hostname change persistent across reboot.
If you want, try to reboot the server with command “reboot” .
Once the server is up, check the hostname.
root# hostname
cloudvedas
root#
It should now show you the new hostname.
If you are using RHEL AMI from AWS marketplace the steps will be slightly different. For that refer our other post How to change hostname in AWS EC2 instance of RHEL 7 .

Solved: How to change the IAM role in Redshift cluster

In our last post we checked How to create a Redshift Cluster?
In this post we will see how to change the IAM role assigned to Redshift cluster.(Check earlier post to know how to create an IAM role.)
Note: Be careful to test the new role first in dev. Don’t try this in prod directly.
  • First create a role as per your requirement.
  • Next login to Redshift Console . Do check you are in correct region.
  • Select the Cluster by clicking on check box.
  • On the top you will see an option of “Manage IAM Roles”.  Click on that.
  • Select the role you created recently from the drop down and click “Apply Changes”
  • It will take 3-5 minutes to reflect the changes.

Solved: How to reset the Master User Password of Redshift Cluster

In our last post we checked How to create a Redshift Cluster?
At times you may want to reset the password of the master user in DB of Redshift.
In this post we will see how to reset the password of  master user in Redshift cluster.
Note:- Ensure that you really want to change the password.  Changing the password in production can break apps which may have old password stored anywhere.
  • Go to Redshift console and click on cluster for which you want to reset the password. In our case it was “testdw” .
  • Once you are inside the cluster configuration click on the “Cluster” drop down and select “Modify”.
  • You will see the field “Master user password”.  Enter the new password in it.
  • Finally click “Modify” .
This will change the master user password. Try connecting to the cluster with the new password.