Although not being a daily operation, you might need to reset the password of root account on some occasions. Here are the steps:
Restart the operating system and press e when prompted.
Move cursor to linux16 line and remove rhgb and quite , add rd.break enforcing=0 as shown below.
Proceed with pressing Ctrl+x in order to access the initramfs(initial RAM file system) that gets loaded into memory during the startup process. Rest of the process is so straight forward. Perform the commands those are written below.
mount -o remount,rw /sysroot
passwd (type the_password_you_want_set twice after hitting “enter” )
mount -o remount,ro /sysroot
When you reach out to login screen, login through root by the typing new password and run the followings.
Mission accomplished successfully :) If you take some “hands-on” certification exams, you probably are not given the “root” account password and you are entailed to reset it. Keep those steps in your mind just in case.
Wish you the best.
If you’re running mysql daemon on an AWS micro instance type AMI like me, you must already have undergone mysqld deadlocks day by day. I guess, to move local mysql db to AWS RDS is the best solution in order to avoid this circumstance.
Creating a swap space is one of the solutions but you may have a limited storage on micro instances.Another solution would be to restart mysqld when it stops by cron jobs :)
Here is my bash script:
[ec2-user@ip-xyz-xyz-xyz-xyz filestores]$ more mybashscript
if [[ ! “$(/sbin/service mysqld status)” =~ “start/running” ]]
/sbin/service mysqld start
Don’t forget to give required permission for your bash file.
chmod +x /home/ec2-user/filestores/mybashscript
And here is crontab (root crontab file!)You can access root crontab file by typing sudo crontab -e command
*/1 * * * * /home/ec2-user/filestores/mybashscript –> Bash will run in every 1 minute.
That’s all, just give it a try. You can find different bash script on the Internet.
Wish you good and prosperity
Have a nice day.
In this post, I am going to cover the sudoers in CentOS7. You all probably know that su means super user or substitute user and sudo means “do as su(per user)” :)
If you login to the system as root user, you are allowed to run all of the commands. I will try to perform several tasks as normal user for you to review the results.
Let’s try to run command by using sudo then.
Continue reading “Linux – Sudoers”
In this blog, I am going to review file and folder permissions which are assigned to user , group and other objects.The very fundamental parameters that are needed to be considered when assigning permissions are User,Group,Others,Read,Write,Execute. In shortly, we can use ugo for user,group,others and rwx for read,write and execute. The table shown below is sufficient to express permissions in octal mode.
Continue reading “Linux – Granting permissions”
Hey dear readers,
In this post, I am going to review user object creation, group object creation, group membership change tasks. The distribution I have setup is CentOS7.
Firstly, I will create few user objects. The very basic command to achieve this task is to run “useradd user_logon_name” .
As you see, the user is created without a password. That’s why, it can not be used to login to the system. To assign a password to the new user , you can run the passwd command as shown below.
Continue reading “Linux – User & Group Basics 2”