1. 程式人生 > >在kali linux 上對普通使用者的操作

在kali linux 上對普通使用者的操作

http://www.blackmoreops.com/2013/11/27/how-to-add-remove-user-standard-user-non-root-in-kali-linux/3/

This guide will walk you through on how to add remove user (standard user or non-root user) in Kali Linux. I’ve tested this in Kali Linux, so any Debian or Debian derivative (such as Ubuntu) should just work.

This guide accomplishes:

The main reason I wanted to try this to demonstrate the followings:

  1. Add a user with all user directories already in place (thereby avoiding “Could not update .ICEauthority var/lib/gdm3/.ICEauthority” or any error containing .ICEauthority or permission in general.
  2. Add user to sudo
    group to allow him to use root commands. You can also add user to ‘lpadmin’ group to allow printing for Canon or HP and such. See Linux printing guide
  3. Change default shell from chsh to bash. Or any shell like Bourne Shell (sh), Bourne-Again Shell (bash), C Shell (csh) or Korn shell (ksh) etc.
  4. Login as that user and demonstrate there were no errors
    .
  5. Be able to use sudo and show groups affinity.
  6. Delete that user safely.

Benefits of Standard User in Kali:

Few benefits you have as non-root or standard user in Kali

  1. Install and run Google Chrome
  2. Install and run Gnome User and Groups manager (Install gnome-system-tools)
  3. Use Kali as Primary Operating System without worrying about breaking it all the time.

Now let’s move onto actual guide.

Add user in Kali Linux:

  • First of all let’s confirm which version of Linux and Kernel I’m running.In command prompt type in
    uname –a
    lsb_release –a

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -1

  • Now let’s add user. Open terminal and type following to create new user (replace user1 with your desired user name)
    useradd -m user1

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -2

    (Note: -m means create home directory which is usually /home/username)

  • Now set password for this user
    passwd user1

    Enter desired password twice

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -3

  • Add user to sudo group (to allow user to install software, allow printing, use privileged mode etc.)
    usermod -a -G sudo user1

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -4

    (Note: -a means append or add and –G mean to specified group/groups)

  • Change default shell of previously created user to bash

    chsh -s /bin/bash user1

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -5

    (Note: chsh mean change login shell, -s is the name of the specified shell you want for the user, in this case /bin/bash)

    Nice, all worked out as expected.
    Let’s logout and login back as our new Standard Non-root user (user1)

Login as new user

  • Once logged in, let’s confirm from command line who I really am! In terminal type in the following
    whoami

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -9

    Take note of [email protected] prompt. That also confirms who you are.

  • And let’s check my group affinity, type in the following in terminal:
    groups

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -10

    Looks good to me so far.

    I am part of user1 group (my primary) and sudo group. That means I can run privileged commands or just become root myself if required.

  • Become root!
    sudo su –

    and type in user1’s password to become root.

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -11

    See the prompt becomes root@kali instead of [email protected]. That means you’re now root and get to run anything Kali got to offer.

  • Lets confirm that using whoami command
    whoami

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -12

    So far so good. Now how do you delete a user?

Delete user in Kali Linux:

  • Log in as root user again. Open terminal and type:
    userdel –r user1

    (Note: -r means delete all files and home directory for user1)

    You can replace user1 with your desired user name.

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -13

    I have an error “user1 is currently used by process 5866”.

    So process ID 5866 is being used by user1. (I know that it’s the gnomekeyring process running in background when I used sudo su – command earlier. (GnomeKeyring error is quite common in Debian when you install multiple Windows or Desktop Managers. There’s a separate guide see How to fix Gnome-Keyring error. This demonstrates how to fix gnomekeyring error for root user). In our case we are not worried as we just want to delete that user.

    Let do that.

  • Type in the following in terminal to kill the process used by user1.
    kill -9 5866

    This kills the process immediately.

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -14

    (Note: don’t kill root or system processes unless you know what you’re doing)

  • Now let’s try to delete the user again.
    userdel –r user1

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -15

    We have a message. “userdel: user1 mail spool (/var/mail/user1) not found”.

    (Note: -r means delete all files and home directory for user1)

    Are we going to worry about it? Not really, we never created a mailbox for user1.

  • Just to confirm everything for user1 was deleted list files in home directory
    ls /home

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -16

    Nothing.. that’s good news, all files and folders were deleted for user1.

  • Want to double-check?
    su user1

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -17

    Perfect user1 was deleted successfully.

Conclusion

Thanks for reading. Don’t forget to check other guides and How to. Follow us on Facebook, Twitter

相關推薦

kali linux 普通使用者的操作

http://www.blackmoreops.com/2013/11/27/how-to-add-remove-user-standard-user-non-root-in-kali-linux/3/ This guide will walk you through

Linux資料庫MySql操作常用命令

進入資料庫客戶端,作用命令mysql -u root -p 輸入密碼,預設為空 sudo systemctl status mysqld 檢視資料庫的狀態 修改mysql密碼: mysqladmin -u使用者名稱 -p舊密碼 password 新密碼 或者是 mysql命令列SET PAS

Linux資料庫操作常用命令

進入資料庫客戶端,作用命令mysql -u root -p 輸入密碼,預設為空 mysql資料庫使用總結 本文主要記錄一些mysql日常使用的命令,供以後查詢。 1.更改root密碼 mysqladmin -uroot password ‘yourpasswor

Kali Linux 安裝Nessus的方法

kali nessus安裝 Nessus是系統漏洞掃描與分析軟件,但Nessus在Kali Linux上的安裝可不簡單,沒有提供一個圖形化的安裝借口,下面就給大家介紹下如何在Kali Linux上安裝Nessus。利用Iceweasel 打開http://www.tenable.com/product

Kali Linux安裝SSH服務

訪問 內容 ron ref 使用 str star 分享 oot 安裝 SSH 從終端使用 apt-get 命令安裝 SSH 包: # apt-get update # apt-get install ssh 啟用和開始使用 SSH 為了確保安全 shell 能夠

白話如何在kali linux多功能截圖以及保證筆記萬無一失(安全版)

note precise 點擊下載 選擇 apt original 官網 packages 商業 技術博客的可讀性非常重要,這也是技術博客寫作的重要原則。 kali linux版本為2018.1 64位 如果使用最新安裝的kali linux,你會發現系統自帶的截圖工具不是

白話kali linux可以安裝什麽小遊戲(好奇版)

意思 好奇心 有一個 貪吃蛇 精神的 入門 ack web cman 技術博客的可讀性非常重要,這也是技術博客寫作的重要原則。 電腦系統是kali linux2018.1版本的,64bit 遊戲是極客精神的產物,這句話沒毛病。 因為之前在windows電腦上一直都是很方便的

linux的一些基本操作

kill 使用 spa 使用情況 linu rep tomcat style 查看 1.chmod a+x 路徑 給某文件授權 2.ps -ef | grep tomcat 查看某服務的端口使用情況 3.kill + 端口

如何在 Linux 驅動器進行分割槽和格式化

這裡有所有你想知道的關於設定儲存器而又不敢問的一切。 在大多數的計算機系統上,Linux 或者是其它,當你插入一個 USB 裝置時,你會注意到一個提示驅動器存在的警告。如果該驅動器已經按你想要的進行分割槽和格式化,你只需要你的計算機在檔案管理器或桌面上的某個地方列出驅動器。這是一個簡單的要求,而且通常計算機

kali linux的安裝以及後續操作

目的: 想學下網路安全等方面的知識 所以安裝了kali linux 因為裡面集成了 很多有用的工具 非常方便 1、應為想要安裝VMware裡面的虛擬機器 所以找一個虛擬映象就行 下載url: https://www.kali.org/downloads/  這裡面可以找到

linux直接寫framebuffer linux 直接 Frame Buffer 操作,寫畫面快取例子,c語言讀寫framebuffer

提供的中斷呼叫來實現直接寫屏,故Linux抽象出FrameBuffer這個裝置來供使用者態   程序實現直接寫屏。   在繼續下面的之前,先說明幾個背景知識:   1、FrameBuffer主要是根據VESA標準的實現的,所以只能實現最簡單的功能。   2、由於涉及核心的問

Linux檔案的操作的相關函式簡介及用法

主要涉及的函式原型及引數解釋: open函式:用於開啟一個普通檔案      函式原型  int open(const char *path,int flag,/*int mode*/);  引數解釋:      const char *path:  即相應路徑下的檔

Kali Linux部署DVWA

XAMPP 是一個易於安裝且包含 MySQL、PHP 和 Perl 的 Apache 發行版。XAMPP 的確非常容易安裝和使用:只需下載,安裝,啟動即可。 安裝步驟: 1.下載下來就是一個.run的檔案,雙擊安裝即可,比之前的壓縮檔案安裝還要簡單。 一直點next就行

linux環境oracle數據庫的數據泵導入導出操作

表結構 數據庫實例 oracle實例 ger 日誌 文件名 dir linu 兩種 需求:公司搭建的報表庫環境數據來自於生產環境oracle數據,因此需要使用kettle將oracle數據每天定時導入到報表數據庫中(本文不討論如何用kettle導數據,不贅述),若要導數據我

解決kali linux 開啟ssh服務後連接不的問題

手機端 linu otl sshd pro 密碼 auth cati nbsp 今天在手機端裝了NetHunter 想連接PC的kali ,可是怎麽都連不上 綜合網友的經驗: 1.修改sshd_config文件,命令為:vi /etc/ssh/sshd_config

LinuxMySQL/MariaDB數據庫的基本操作以及linux mysql添加用戶,刪除用戶,以及用戶權限的授予

信息 查看 let quit mar 普通用戶 表名 mys xxxx 文章引用地址:https://www.cnblogs.com/Glory-D/p/7518541.html、https://www.cnblogs.com/zhchoutai/p/6929103.htm

MongoDB在linux的基本操作

MongoDB在linux上的基本操作 一、mongodb/bin下的命令 1.登入 2.mongostat狀態檢測 1)語法 2)結果 3.mongotop狀態檢測 1)語法

C語言指標——普通變數的指標操作陣列(常量)的指標操作

       我們知道,每一個變數都有一個記憶體位置,每一個記憶體位置都定義了可使用連字號(&)運算子訪問的地址,它表示了在記憶體中的一個地址。        我們喜歡在程式中使用指標代替陣列,因為變數指標可

Linux使用rz和sz操作傳和下載檔案

rz軟體安裝 (1)編譯安裝 root 賬號登陸後,依次執行以下命令: 1 cd /tmp 2 wget http://www.ohse.de/uwe/releases/lrzsz-0.12.20.

Linux目錄的讀寫操作代表著什麼意思?

結論: a目錄有執行許可權表示可以cd 到這個目錄裡面 a目錄有讀許可權表示可以 ls a 這個目錄 a目錄有寫許可權表示可以在進入cd之後,能夠進行建立刪除檔案和目錄 實驗: [[email protected] ~]$ pwd /ho