Post about the hacking Linux OS using the user administration. We will discuss many linux hacks by which we can play around with user security.
Blocking any normal user from logging into the system.
You can perform any one of the below linux hack so that particular user cannot logging in to the system.
1. Replacing ‘x’ with ‘*’ in the second field of /etc/passwd.
[root@rhel1 ~]# cat /etc/passwd|grep -i test testuser:*:500:500::/home/testuser:/bin/bash [root@rhel1 ~]#
2. Change the default shell of user to /sbin/nologin wither using the 7th field of /etc/passwd or by using the command.
[root@rhel1 ~]# chsh testuser Changing shell for testuser. New shell [/bin/bash]: /sbin/nologin Shell changed. [root@rhel1 ~]#
3. Changing the 8th field /etc/shadow to 0.
[root@rhel1 ~]# cat /etc/shadow|grep test testuser:$6$gFZOkJ.9$AhMOsn/R6G1PQBXcN.KesHlCVa5ylALdqjcZuWSsL6p24YGq5pnciT12fhysewIJWUwc6uoafaIS9KkieTjGc0:17166:0:99999:7::0: [root@rhel1 ~]#
4. Commenting the line corresponding to the user in /etc/passwd.
[read more=”Read more” less=”Read less”]
[root@rhel1 ~]# cat /etc/passwd|grep -i test #testuser:x:500:500::/home/testuser:/bin/bash [root@rhel1 ~]#
Above all four ways describes how we can perform linux hack over any particular user, Now Lets perform linux hack over all linux user base.
5. To Block all the normal users of system from logging in , create a file ‘nologin’ in /etc. If there is no text given in the file,users will not be given any message when they sign in using their username and
password and the prompt will return back to login.
Now for performing linux hack for root user use any one of the below:
6.Changing the 8th field /etc/shadow to 0 for the root entry.(which can be only done by root as he is the only one who can read the file.
7. you can also comment below lines corresponding to device drivers in the file /etc/securetty i.e commenting the following fields -:
tty1 tty2 tty3 tty4 tty5 tty6 tty7 tty8 tty9 tty10 tty11
These are the 7 ways of doing Linux hack on the system. You can give it try for the same.