วันพุธที่ 20 พฤศจิกายน พ.ศ. 2562

Linux Command

^^Add-User

$ sudo useradd -s /bin/bash -d /home/vivek/ -m -G sudo vivek
$ sudo passwd vivek


  • -s /bin/bash – Set /bin/bash as login shell of the new account
  • -d /home/vivek/ – Set /home/vivek/ as home directory of the new Ubuntu account
  • -m – Create the user’s home directory
  • -G sudo – Make sure vivek user can sudo i.e. give admin access to the new account

^^Add group

$ sudo usermod -a -G groupName userName

  • The -a (append) switch is essential. Otherwise, the user will be removed from any groups, not in the list.
  • The -G switch takes a (comma-separated) list of additional groups to assign the user to



$ cat /etc/passwd
$ cat /etc/group
$ iptables -L



ไม่มีความคิดเห็น:

แสดงความคิดเห็น