User Management: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
New page: To Create a user on a Linux system <pre> useradd <username> </pre> To Delete a user <pre> userdel <username> </pre> To change a users password <pre> passwd <username> </pre> [[Category : L...
 
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
To Create a user on a Linux system
= Create =
<pre>
<pre>
useradd <username>
useradd -m <username>
</pre>
</pre>
To Delete a user
 
= Delete =
<pre>
<pre>
userdel <username>
userdel -r <username>
</pre>
</pre>
To change a users password
 
= Change Password =
<pre>
<pre>
passwd <username>
passwd <username>
</pre>
</pre>
= Disable Account =
<pre>
passwd -l <username>
</pre>
= Assign root permissions =
'''For Debian'''<br>
<pre>
vi /etc/sudoers
</pre>
<pre>
<username> ALL=(ALL) NOPASSWD: ALL
</pre>
= Impersonate root =
'''For CentOS/Linux and Debian'''<br>
Give an account root permissions. (Different from above)<br>
This will make the user seen as root even though logged in as a different account.
<pre>
vi /etc/passwd
</pre>
Find the user in question and modify assigned number, in this example 501:501 to be 0:0
example<br>
from
<pre>
timmy:x:501:501::/home/timmy:/bin/bash
</pre>
to
<pre>
timmy:x:0:0::/home/timmy:/bin/bash
</pre>
[[Category : Linux]]
[[Category : Linux]]

Latest revision as of 09:57, 1 December 2014

Create

useradd -m <username>

Delete

userdel -r <username>

Change Password

passwd <username>

Disable Account

passwd -l <username>

Assign root permissions

For Debian

vi /etc/sudoers
<username> ALL=(ALL) NOPASSWD: ALL

Impersonate root

For CentOS/Linux and Debian
Give an account root permissions. (Different from above)
This will make the user seen as root even though logged in as a different account.

vi /etc/passwd

Find the user in question and modify assigned number, in this example 501:501 to be 0:0 example
from

timmy:x:501:501::/home/timmy:/bin/bash

to

timmy:x:0:0::/home/timmy:/bin/bash