User Management: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
To Create a user on a Linux system
= Create =
<pre>
<pre>
useradd <username>
useradd <username>
</pre>
</pre>
To Delete a user
 
= Delete =
<pre>
<pre>
userdel -r <username>
userdel -r <username>
</pre>
</pre>
To change a users password
 
= Change Password =
<pre>
<pre>
passwd <username>
passwd <username>
</pre>
</pre>
To disable an account
 
= Disable Account =
<pre>
<pre>
passwd -l <username>
passwd -l <username>
</pre>
</pre>
Give an account root permissions
 
= Assign root permissions =
<pre>
<pre>
vi /etc/sudoers
vi /etc/sudoers
Line 22: Line 26:
<username> ALL=(ALL) NOPASSWD: ALL
<username> ALL=(ALL) NOPASSWD: ALL
</pre>
</pre>
= Impersonate root =
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, typically 500:500 to be 0:0
example<br>
from
<pre>
timmy:x:500:500::/home/timmy:/bin/bash
</pre>
to
<pre>
timmy:x:0:0::/home/timmy:/bin/bash
</pre>
[[Category : Linux]]
[[Category : Linux]]

Revision as of 02:57, 22 April 2014

Create

useradd <username>

Delete

userdel -r <username>

Change Password

passwd <username>

Disable Account

passwd -l <username>

Assign root permissions

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

Impersonate root

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, typically 500:500 to be 0:0 example
from

timmy:x:500:500::/home/timmy:/bin/bash

to

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