Lesson 2: Managing Users and Groups Flashcards
echo (command)
Repeats input back to the user on the screen.
***commonly used to send information to the user in a script.
ls (command)
Lists the contents of a directory. Can be given options to view permissions, hidden files, etc.
pwd (command)
Displays the current working directory you are in.
cd (command)
Changes your current working directory.
touch (command)
Updates timestamp on an existing file, but can also be used to create an empty file.
cp (command)
Copies a file or directory to another location.
mkdir (command)
Creates a directory.
cat (command)
is used to view the contents of a file without the option to edit that file.
less (command)
is used to view the contents of a file when those contents won’t fit entirely on one screen. breaks the content output into pages that you can scroll through at the CLI
vim
Starts a powerful text editorand the default for Linux.
nano (command)
Starts a simple, user-friendly text editor. It may not be installed on all distros.
gedit (command)
Starts a GUI text editor that is easy to use. Requires a desktop environment to be installed.
su (command)
“substitute user” switches user credentials
The syntax of the su command is su [-] [user name]
Note: Without a user name argument, the su - command will assume you mean to lesign in as root.
sudo (command)
Executes command as root
Password cached for five minutes by default
su - (command)
Switches to root
What command do we use to create a user account?
useradd
example: useradd jdoe
Or you can do something like useradd jdoe -c “John Doe” -e 2019/12/31 -s /bin/dash -d /home/john_doe
What three commands will allow you to modify a user?
You can you userdel, usermod, or chsh
Wsshat is the default password for the user?
There is no default password for user. One will have to be created using: passwd
How can you view user defaults?
useradd -D
What is the principle of least privilege?
users should be given no more authority on the system than they need to perform their job