04 Flashcards
What are the two types of shell variable? what’s the difference between them?
Local: variables can only be executed in the shell that you are in
environmental variables are made global and can be executed in children shells of that parent process
What command displays existing shell variables, Enviromental variables, and shell functions?
what command shows only environmental variables?
set
env
What’s the syntax for creating a variable/command variable?
Hello=Greeeting
machine=$(uname)
What command makes a variable globally accessible?
export
Whihc of these are user specific, and which are system wide?
~/.bash_profile
~/.bashrc
/etc/bash_profile
/etc/bashrc
user
user
public
public
Whist command and syntax lets me save changes and make them appear now instead of rebooting/logging off? To the
bash_profile or bash_rc?
source ~./bash_profile
source /etc/bash_profile
What must be at the beginning of a bash shell script?
What must be at the beginning of a PowerShell script
How do you run a script?
!/bin/bash
bash ./scriptname.sh
if your in directory ./scriptname.sh
What’s the difference between a login shell and a non-login shell?
What command tells me whether im in a login shell or not?
One is a remote login using telnet or ssh, the other dosen’t require a login at all
echo $0
What file shows me a history of all entered commands?
and how do I access it?
~/.bash_history
echo $histfile
A ______________ restricts the activities of users on a shell
restricted shell
Which of these are used for authentication/authorization or both?
/etc/shadow
/etc/passwd
/etc/group
authentication
authentication and authorization
authorization
What file contains general user information and what are it’s fields?
/etc/passwd u passed up good chicks doing shots
Username
placeholder for hashed Password
UID
GID
Comment (what they see on the login screen)
Home Directory
Default shell /bin/bash
What file contains all the users password information and its fields?
/etc/shadow U Have lost many matches, winning is everything
Username
Hashed password
Last pswd change
Minimum password length
maximum password length
Warning
inactive
expiration date
What file contains all the group information? And what are its fields?
/etc/group good pussy gets soupy
Group name
Password
Group ID
Supplementary members
Within /etc/passwd how can I tell if an account has never logged in or is disabled?
How can I lock or unlock an account?
in the hashed password field there if these is a !! then that account has never logged on
passwd -l jim
passwd -u jim