Saturday, August 22, 2020

Linux Command Line Hackery Series - Part 6


Welcome back to Linux Command Line Hackery series, I hope you've enjoyed this series so far and would have learned something (at least a bit). Today we're going to get into user management, that is we are going to learn commands that will help us add and remove users and groups. So bring it on...

Before we get into adding new users to our system lets first talk about a command that will be useful if you are a non-root user.

Command: sudo
Syntax: sudo [options] command
Description: sudo allows a permitted user to execute a command as a superuser or another user.

Since the commands to follow need root privileges, if you are not root then don't forget to prefix these commands with sudo command. And yes you'll need to enter the root password in order to execute any command with sudo as root.

Command: useradd
Syntax: useradd [options] username
Description: this command is used for creating new user but is kinda old school.
Lets try to add a new user to our box.
[Note: I'm performing these commands as root user, you'll need root privileges to add a new user to your box. If you aren't root then you can try these commands by prefixing the sudo command at the very beginning of these command like this sudo useradd joe. You'll be prompted for your root password, enter it and you're good to go]

useradd joe

To verify that this command has really added a user to our box we can look at three files that store a users data on a Linux box, which are:

/etc/passwd -> this file stores information about a user separated by colons in this manner, first is login name, then in past there used to be an encrypted password hash at the second place however since the password hashes were moved to shadow file now it has a cross (x) there, then there is user id, after it is the user's group id, following it is a comment field, then the next field contains users home directory, and at last is the login shell of the user.

/etc/group  -> this file stores information about groups, that is id of the group and to which group an user belongs.

/etc/shadow -> this file stores the encrypted password of users.

Using our command line techniques we learned so far lets check out these files and verify if our user has been created:

cat /etc/passwd /etc/group /etc/shadow | grep joe



In the above screenshot you can notice an ! in the /etc/shadow, this means the password of this user has not been set yet. That means we have to set the password of user joe manually, lets do just that.

Command: passwd
Syntax: passwd [options] [username]
Description: this command is used to change the password of user accounts.
Note that this command needs root privileges. So if you are not root then prefix this command with sudo.

passwd joe



After typing this command, you'll be prompted password and then for verifying your password. The password won't show up on the terminal.
Now joe's account is up and running with a password.

The useradd command is a old school command, lets create a new user with a different command which is kinda interactive.

Command: adduser
Syntax: adduser [options] user
Description: adduser command adds a user to the system. It is more friendly front-end to the useradd command.

So lets create a new user with adduser.

adduser jane



as seen in the image it prompts for password, full name and many other things and thus is easy to use.

OK now we know how to create a user its time to create a group which is very easy.

Command: addgroup
Syntax: addgroup [options] groupname
Description: This command is used to create a new group or add an existing user to an existing group.

We create a new group like this

addgroup grownups



So now we have a group called grownups, you can verify it by looking at /etc/group file.
Since joe is not a grownup user yet but jane is we'll add jane to grownups group like this:

addgroup jane grownups



Now jane is the member of grownups.

Its time to learn how to remove a user from our system and how to remove a group from the system, lets get straight to that.

Command: deluser
Syntax: deluser [options] username
Description: remove a user from system.

Lets remove joe from our system

deluser joe

Yes its as easy as that. But remember by default deluser will remove the user without removing the home directory or any other files owned by the user. Removing the home directory can be achieved by using the --remove-home option.

deluser jane --remove-home

Also the --remove-all-files option removes all the files from the system owned by the user (better watch-out). And to create a backup of all the files before deleting use the --backup option.

We don't need grownups group so lets remove it.

Command: delgroup
Syntax: delgroup [options] groupname
Description: remove a group from the system.

To remove grownups group just type:

delgroup grownups



That's it for today hope you got something in your head.

More info


  1. Hacking Tools Free Download
  2. Best Pentesting Tools 2018
  3. Hacker Tools Windows
  4. Pentest Tools Website
  5. Hack Tools Online
  6. Growth Hacker Tools
  7. Hack Website Online Tool
  8. Hacker Tools List
  9. Pentest Tools Open Source
  10. Pentest Tools Linux
  11. Hacker Tools Windows
  12. Hacking Tools And Software
  13. Hacker Tools List
  14. Hacker Tools Linux
  15. Pentest Tools Free
  16. Hacker Techniques Tools And Incident Handling
  17. Pentest Tools Tcp Port Scanner
  18. Pentest Tools Kali Linux
  19. Hacking Tools Software
  20. Hack And Tools
  21. Usb Pentest Tools
  22. Hacking Tools For Windows
  23. Hack Tools Pc
  24. Hacking Tools For Beginners
  25. Usb Pentest Tools
  26. Hack Tools Mac
  27. Tools For Hacker
  28. Tools For Hacker
  29. Hacker Tools Hardware
  30. Hacking Tools Download
  31. Hack Tools Download
  32. Ethical Hacker Tools
  33. Hacking Tools 2020
  34. Black Hat Hacker Tools
  35. Hacker Tools Github
  36. Pentest Tools Subdomain
  37. Hack Tools Download
  38. Ethical Hacker Tools
  39. Pentest Tools For Ubuntu
  40. Hackers Toolbox
  41. Hacking Tools 2020
  42. Nsa Hacker Tools
  43. Hack Tools Online
  44. Pentest Tools Alternative
  45. Hacker Tools Linux
  46. Hack App
  47. Hacking Tools 2019
  48. Pentest Tools Github
  49. Hacker
  50. Hack Tools For Mac
  51. Pentest Tools Github
  52. Hacking Apps
  53. Best Hacking Tools 2019
  54. Nsa Hacker Tools
  55. Hackrf Tools
  56. Pentest Tools For Mac
  57. Pentest Tools For Windows
  58. Hackers Toolbox
  59. Pentest Tools Bluekeep
  60. Hacker Tools Software
  61. Pentest Tools For Mac
  62. Pentest Tools For Mac
  63. Pentest Tools Open Source
  64. Tools For Hacker
  65. Pentest Tools Url Fuzzer
  66. Tools For Hacker
  67. Pentest Reporting Tools
  68. Hacker Tools List
  69. Pentest Tools Find Subdomains
  70. Hacker Tools Mac
  71. Hack Tools For Windows
  72. Hacker Tool Kit
  73. Hacking Tools For Beginners
  74. Hacker Tools Hardware
  75. Hack App
  76. Pentest Tools Bluekeep
  77. Hacking Tools Windows
  78. Hacking Tools Name
  79. Bluetooth Hacking Tools Kali
  80. Pentest Reporting Tools
  81. Hacker Techniques Tools And Incident Handling
  82. Hacking Tools Kit
  83. Hacker Tools Mac
  84. Hacking Tools 2019
  85. Hacking Tools Free Download
  86. Hacker
  87. Hack Tools Pc
  88. Wifi Hacker Tools For Windows
  89. Hack Website Online Tool
  90. Hacking Tools Pc
  91. World No 1 Hacker Software
  92. Hacker Tools For Ios
  93. Pentest Tools Subdomain
  94. Pentest Recon Tools
  95. Pentest Tools Website Vulnerability
  96. Pentest Tools Download
  97. Pentest Tools Port Scanner
  98. Pentest Tools Alternative
  99. Hack Rom Tools
  100. Hacker Tools For Mac
  101. Pentest Tools Android
  102. Hacker Tool Kit
  103. Ethical Hacker Tools
  104. Pentest Recon Tools
  105. Pentest Tools Download
  106. Pentest Tools Linux
  107. Hacking Tools Pc
  108. Pentest Tools Subdomain
  109. Hacker Tools Free Download
  110. Pentest Recon Tools
  111. New Hacker Tools
  112. Hack Rom Tools
  113. Pentest Tools
  114. Hacks And Tools
  115. Hacking Tools Pc
  116. How To Make Hacking Tools
  117. Hacking Tools For Windows 7
  118. Pentest Automation Tools
  119. Hacker Techniques Tools And Incident Handling
  120. Hacker Tools List
  121. Top Pentest Tools
  122. Hacker Tools Software
  123. Hacking Tools Pc
  124. Beginner Hacker Tools
  125. Hack Tools 2019
  126. Usb Pentest Tools
  127. Hackrf Tools
  128. Hackers Toolbox
  129. Pentest Tools Linux
  130. Hacking Tools Download
  131. Tools Used For Hacking
  132. Hacking Tools For Kali Linux
  133. Pentest Tools Nmap
  134. Pentest Reporting Tools
  135. Hacking Tools For Beginners
  136. How To Make Hacking Tools
  137. Hacking Tools Online
  138. Pentest Tools For Android
  139. Hacker Tools Apk Download
  140. Hack Tools For Mac
  141. Pentest Tools Online
  142. Pentest Tools Online
  143. Hacking Tools
  144. Pentest Tools Github
  145. Hacking Apps
  146. Hacker Tools Linux
  147. Hack Tools For Games
  148. Hacker Tools Free Download
  149. Hack Tools For Ubuntu
  150. Nsa Hack Tools
  151. Usb Pentest Tools
  152. Android Hack Tools Github
  153. Pentest Tools For Android
  154. Android Hack Tools Github
  155. Nsa Hack Tools Download
  156. Hacker Tools 2020
  157. Pentest Tools List
  158. Hacking Tools For Games
  159. Hacking Tools Online
  160. Hacking Tools Name
  161. Pentest Tools Tcp Port Scanner
  162. Best Pentesting Tools 2018
  163. Computer Hacker
  164. Hacking Tools
  165. Pentest Tools Apk
  166. Hacking Tools Github
  167. Tools For Hacker
  168. Hack Tools Download
  169. Hack Tools Pc
  170. Nsa Hacker Tools
  171. Pentest Tools Review
  172. Hacking Tools 2020
  173. Hacker Tools Hardware
  174. Hacking Tools Hardware
  175. Pentest Tools Download
  176. Hacking Tools For Mac
  177. Hacking Tools Name

No comments:

Bloomberg - UTV

Must Watch...Ad may come initially.. wait for video.Also keep volume on

Disclaimer



This Document is subject to changes without prior notice and is intended only for the person or entity to which it is addressed to and may contain confidential and/or privileged material and is not for any type of circulation. Any review, retransmission, or any other use is prohibited. Kindly note that this document does not constitute an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction.


The information contained herein is from publicly available data or other sources believed to be reliable. While I would endeavour to update the information herein on reasonable basis, I am under no obligation to update or keep the information current. Also, there may be regulatory, compliance, or other reasons that may prevent me from doing so. I do not represent that information contained herein is accurate or complete and it should not be relied upon as such. This document is prepared for assistance only and is not intended to be and must not alone betaken as the basis for an investment decision. The user assumes the entire risk of any use made of this information. Each recipient of this document should make such investigations as it deems necessary to arrive at an independent evaluation of an investment in the securities of companies referred to in this document (including the merits and risks involved), and should consult its own advisors to determine the merits and risks of such an investment. The investment discussed or views expressed may not be suitable for all investors. I do not undertake to advise you as to any change of my views. I may have issued other reports that are inconsistent with and reach different conclusion from the information presented in this report. This report is not directed or intended for distribution to, or use by, any person or entity who is a citizen or resident of or located in any locality, state, country or other jurisdiction, where such distribution, publication, availability or use would be contrary to law, regulation or which would subject me to any registration or licensing requirement within such jurisdiction. The securities described herein may or may not be eligible for sale in all jurisdictions or to certain category of investors. Persons in whose possession this document may come are required to inform themselves of and to observe such restriction. I may have used the information set forth herein before publication and may have positions in, may from time to time purchase or sell or may be materially interested in any of the securities mentioned or related securities. I may from time to time solicit from, or perform investment banking, or other services for, any company mentioned herein. Without limiting any of the foregoing, in no event shall I or any third party involved in, or related to, computing or compiling the information have any liability for any damages of any kind.