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
What command permits a user to edit a file with their own credentials, even if the file is only available to root user?
sudo edit
The syntax of the sudo edit command is sudo edit [options] {file name} -> sudo edit /path/to/file
What is the wheel group?
Distributions allow administrative functions based on membership in the wheel group.Members of the wheel group exercise the administrative privileges of root with less potential for damaging the system.
Which file allow you to configure a user with superuser privileges and how do you get to that file?
Enter visudo to open the /etc/sudoers file
Whalesst file can you view all of the following “User name, Password, User ID, Group ID, Comment, Home directory and Login shell”?
The /etc/passwd file