Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to make new user linux termil

sudo useradd -m username

#set user password
sudo passwd username

#add user to sudoers [DANGEROUS]
usermod -aG sudo username
Comment

linux create user

sudo useradd username
Comment

How to create or add a user on linux

#To create a user
sudo useradd -m username

#to set user password
sudo passwd username

# to add a user to sudoers [FOR ADMIN ACCESS]
usermod -aG sudo username
Comment

create user linux

sudo useradd -U -m -d '/home/user' -s '/bin/bash' user
Comment

Add user linux

sudo usermod -a -G www-data pi
Comment

command to create a user in linux

#to create a home directory while adding the user
sudo useradd -m username

#to remove a user
sudo userdel username

#to create a specific home directory for the user anywhere
sudo useradd -m -d /opt/username username

#to create a specific userID (UID)
sudo useradd -u 1500 username

#to verify UID
id -u username

#to create a user in a specific group
sudo useradd -g GROUP username

#to verify above command
id -gn username

#to create a user and assign multiple groups
sudo useradd -g primary_group -G group2,group3 username

#to check
id username

#to create a user with a comment
sudo useradd -c "Comment" username

#to verify
grep username /etc/passwd

#to crete a user with an expiry-date
sudo useradd -e YYYY-MM-DD username

#to verify account expiry date
sudo chage -l username

#to view useradd default options
useradd -D

#to change useradd default options
#e.g default login shell from /bin/sh to /bin/bash
sudo useradd -D -s /bin/bash

#to verify
sudo useradd -D | grep -i shell
Comment

Add user Linux

sudo adduser ben
Comment

create user in linux

useradd [OPTIONS] USERNAME
Comment

add user linux

adduser [OPTIONS] USERNAME
Comment

linux add user

sudo adduser "username" #more interactive than useradd (ubuntu based)
Comment

PREVIOUS NEXT
Code Example
Shell :: install laravel on ubuntu 
Shell :: bash array forloop 
Shell :: how to compile 64 bit nasm 
Shell :: ver particiones montadas linux 
Shell :: npm vs yarn command 
Shell :: run apache xampp 
Shell :: create a new branch and publish gitub 
Shell :: merge master to dev branch 
Shell :: git init command 
Shell :: dos view all files 
Shell :: jupyter digits 
Shell :: bash split array into chunks 
Shell :: error: required key missing from keyring 
Shell :: git add remote 
Shell :: docker run command on container 
Shell :: git remove first stash 
Shell :: Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058" 
Shell :: macos netcat start listening 
Shell :: installing appimage file ubuntu 
Shell :: redis client find key 
Shell :: restore git stash 
Shell :: github checkout branch 
Shell :: linux add alias 
Shell :: how to delay a script from running linx terminal 
Shell :: bash change command prompt 
Shell :: bash store pipe output in variable 
Shell :: git ignore after commit 
Shell :: This is a GitLab CI configuration to build the project as a docker image 
Shell :: start grafana server wsl 
Shell :: scan all udp ports nmap 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =