Week 10 - 13
Command Structure
#command <arguments or options> <value>
Display your default shell $
#echo $SHELL
Commands
#history (only bash) Will display a list of previous executed commands #exit to exit out of the bash shell back to the bourne shell. #bash switch from the bourne shell to the bash shell -The bash shell is more advanced than the bourne shell & comes w/more tools than the bourne shell. -the up arrow recalls previous commands (only bash)
Display the IP address of the Solaris Server $
#ifconfig -a (ifconfig=Interface Configuration)
What command will display the entire content of your pwd? $
#ls -a
Will display hidden content or components in a directory
#ls -a
Will display the attributes of each component as well as display the entire content in the directory
#ls -al
Will display the content of a directory including the attributes of each component
#ls -l
Long list the file /etc/passwd
#ls -l /etc/passwd
Display the attributes of the directory /tmp
#ls -ld /tmp -d = directory
Examples of ls command
#ls -ld /tmp (Will display the attributes of the directory) #ls -l /tmp (Will display the content of the directory including the attributes of each component) #ls /tmp (Will display the content of /tmp #ls -al /tmp (Will display the entire content of the directory including attributes of the components)
Display the size of the file /etc/nsswitch.conf
#ls -lh /etc/nsswitch.conf -h = (human readable format) The -h helps to round up numbers. It will round up the size of the component to the next "measuring unit." (It's about the units, not numbers)
Create a password for the User, Student $
#passwd student To Verify, #cat /etc/passwd (Display the content of the file /etc/passwd. The /etc/passwd file stores System User Account components) #finger student (Will display details about the User Account) (left ctrl + c, to bring prompt back)
What command is used to create user accounts in Unix/Linux $
#useradd
Create a user account
#useradd -c "Allen Lulu" -d /export/home/lulu -s /bin/bash -m lulu -c = Specify the User's fullname (c=comment) -d = Specify Home Directory of User (d=directory) -s = Specify default shell of user (s=shell) -m = Create the home directory at the path specified by the -d option. (Unix/Linux is case-sensitive)
Display the output of the file /etc/passwd, but omit the line associated with root.
$grep -v root /etc/passwd or $cat /etc/passwd | grep -v root
Display the number of lines from the file /etc/passwd, the line for student & root are excluded.
$grep -v student /etc/passwd | grep -v root /etc/passwd | wc -l
Joining your Windows 10 NOS to your domain
* Both the DC & the NOS system must be up & running -Change DNS server IP of the NOS to the IP address of the DC. --- Right click on network icon & select open network & sharing center. > click "change adapter settings" > right click on nic & select properties. (Uncheck IPv6 as well) -Connect the system to the domain --click on library folder, right click on this pc & go to property > click change settings & click on change. --change the hostname to win10pro1 & the domain name to the domain name of the DC. (class27domain.local) --use the domain administrator account to login > reboot -Login to the Domain after reboot Username: class27domain\administrator In Domain Controller, Active Directory Users & Computers > Computers folder // you should see the Windows 10 NOS in there
The WC command (Word Count)
- $wc -l /etc/passwd (to display the total number of lines in the file passwd) - -l = Total number of lines - $wc -c /etc/passwd (to display the total number of characters in the file passwd)
The Unix / Linux Filesystem Structure
- Everything starts from Root -Refer to Week 11 Day 2 notes to see picture of structure Absolute Path: It is the route or path to the component starting from root. (Ex. /usr/bin) Relative Path: It is the path or route to a component starting from your pwd, or relative to your current location. Ex.) $cd /usr/sbin (absolute) Ex.) $cd ../../../usr/sbin (relative) Ex.) Move from /export/home/class27 into /export/home, using relative path - $cd .. Ex.) Move from /export/home/class27 into /export using relative path - $cd ../..
The Tail Command
- Used to display the last lines of the file or an output - $tail /etc/passwd (will display the last 10 lines of the file) -$tail -3 /etc/passwd (will display the last 3 lines of the file) -$tail -1 /etc/passwd (will display the last line of the file)
The du command (Disk use or usage)
- Used to display the size of a directory Ex.) Display the size of the directory var - #du -sh /var -s = size -#du -h /var (Will display the content of the directory & the size of each component)
The output of an attribute pulled from the command #ls -l /etc/passwd
- or d (Component Type = - for files, d for directory) rw-r--r-- (Permission Attributes) 1 (filesystem block number) root (Component's owner) sys (Primary Group of the Component's owner) 839 (Component's size in bytes, if no description is next to number, it is measured in bytes) Jul 21 04:07 (Date & Time of last modification of this component /etc/passwd (The component)
Used to display a list of previous executed commands in the bash shell
-$ history - !1 (to re-run command number 1 from the list)
The Sort Command
-$sort /etc/passwd (Will arrange the content of the file /etc/passwd in alphabetical order A-Z) -$sort -r /etc/passwd (Will arrange the content of the file from Z - A. - r = reverse sort
APIPA Address (Automatic Private IP Address) $
-169.x.x.x -Assigned when system is unable to get an address from DHCP -The APIPA address is assigned by the IP stack of the system -A system w/ the APIPA address can not communicate w/ other systems in the LAN. -It will also be sending out an DHCP Broadcast request every 5 seconds
Troubleshooting in Cisco Packet Tracer HW#9 $
-Add PC3 to DNS server, there is no A record for PC3 One issue that you had with a Windows/Network problem Explanation: I had a system that was not communicating with other systems in a LAN. Other systems could ping it's IP address, but not its hostname. The issue was that the system didn't have an A record in the DNS server. Once added, the system was able to communicate effectively with other systems in the LAN.
UNIX POST Installation Procedure
-Console Login -Command Terminal Access -Create a user account -Display system's IP address -Terminal Login
Root
-It is the main admin account in UNIX/Linux & it has unrestricted access to the system -The root account is created when installing the OS.
Promote your Windows 2008 to a Domain Controller
-Start Button > search "dc promo" -Run command & click next -Select "create a new domain" -Set forest functional level -Once finished, you restart Notes: Forest = has more than one domain Forest functional level = means the year of that version & up can join domain. Administrative Tools = to see active directory database Set up DNS = put the IP address of the system or the loopback address to make system its own dns server.
The Pipe Option "|"
-Used to combine commands Ex.) command 1 (output) | command2 (input) -It isn't a command, it works with others commands -Final output will be displayed to the prompt. Ex.) $cat /etc/passwd | wc -l - The output of the first command which is the content of /etc/passwd will be piped or sent to the word count and the final output will be the output of the word count command.
The Head Command
-Used to display the first 10 lines of a file or output - $head /etc/passwd (to display the first 10 lines of /etc/passwd - $head -3 /etc/passwd (to display the first three lines of the file) - $head -1 /etc/passwd (to display the first line of the file /etc/passwd)
The Grep Command
-Used to filter out information from the output of a command. - Display the line associated with the word "student" from the content of the file /etc/passwd -- $grep student /etc/passwd or $cat /etc/passwd | grep student -Display any line from /etc/passwd that has the word "Super" -- $grep Super /etc/passwd -- $grep -i super /etc/passwd -i = ignore case sensitivity
The CD command (Change Directory)
-Used to move from one directory to another -$cd /tmp (to move from our pwd to the directory /tmp) --- $pwd (to verify) --- $cd (and press enter) to go back home - $pwd (to verify)
Fun Fact
-You learn commands through muscle memory, not memory alone. You must work in a team, not a lone wolf approach.
NOS
-designed for business use -comes with networking tools (Ex. RDP) -You can RDP into NOS, but not into a Home Base OS -can join a domain
Home base OS
-designed for home use & entertainment -does not come with networking tools -can not join a domain
Local Domain
-group of systems in a LAN managed by a DC -used to create & manage resources in a LAN -used as security & authentication platform in LAN -used for SSO (Single Sign On) authentication. -.local
Public Domain
-set up by a domain hosting company -used to host websites & applications -.com
The Kernel
-the core r heart of a unix/linux OS -executes commands from the shell -It is that part or component of the UNIX /Linux OS that communicates w/ system hardware.
The CAT Command (Catalog)
-used to display the content of a file -$cat /etc/passwd (to display the content of the file passwd) To display the content of the file /etc/passwd and number the lines as well - $cat -n /etc/passwd - -n = number each line
The copy command (cp) - Used to copy & paste
1. Copy the file class27 from your pwd into the directory unix27 $cp class27 unix27 $ls unix27 (to verify) Command format $cp <file> <destination directory> $cp -r <directory> <destination directory> $cp -R <files + directories> <destination directory> 2. Copy the files f1 & f2 into the directory unix27 all at once $cp f1 f2 unix27 $ls unix27 (to verify) 3. Copy the directory d1 from your pwd into the directory unix27 $cp -r d1 unix27 $ls unix27 (to verify) 4. Copy every file that starts with an "f" into the directory d27a all at once $cp f* d27a $ls d27a (to verify) 5. Copy the content of the directory unix 27 from your pwd into the directory d27 $cp -R unix27/* d27 $ls -l d27 (to verify)
The mkdir command - used to create directories
1. Create a directory called unix27 in your pwd $mkdir unix27 $ls (to verify) 2.Create the directories d1/d2/d3/d4 all at once - this is a directory tree, there are subfolders. $mkdir -p d1/d2/d3/d4 (to create the directory tree) $ls (to verify the parent directory "d1") IQ: $ls -R d1 (Do a recursive list on the parent directory) -R = Recursive (will display the entire directory tree)
Unix/Linux Foundational or Kernel Commands $$
1. Display your current location in the Unix/Linux filesystem #pwd 2. Clear your current interface #clear 3. Display the user currently logged into a shell prompt. #who am i (#whoami "In Linux) or #logname 4. The list command (ls) -ls is used to display the content of a directory #ls (to display the content of your pwd) #ls /tmp (to display the content of the directory /tmp) #ls /a (will display the entire content of your pwd including hidden content) -A hidden component is any component that starts w/a "." (dot) #ls -l (will display the content of your pwd, including the attributes of each component.) #ls -al /tmp (will display the entire content of /tmp, including the attributes of each component) -a = Display all content including hidden content -l = Long list ( will display attributes) (Study carefully the output of each command to understand the command)
Workgroup
A group of systems, connected together, belonging to a LAN, sharing info w/o a Central Server
What is a shell? $
A shell receives & interprets commands from the prompt. It then sends the commands to kernel were they are executed. The command terminal sits upon the shell.
3. List some popular cloud computing vendors that you know
AWS by Amazon, Icloud by Apple, MS Azure, Google Cloud, IBM Smart Cloud Rackspace, Digital Ocean
What is the difference between the AWS Region and Availability zone?
AWS operates 21 Regions all over the world with announced plans for 4 more. An AWS region is a specific physical geographical location that contain multiple availability zones AWS operates 64 Availability Zones (AZ) worldwide with announce plans for 12 more. An AZ contains 2 or more Datacenters each with redundant power, connectivity and networking Each Amazon Region is designed to be completely isolated from the other Amazon Regions. This achieves the greatest possible fault tolerance and stability. Each Availability Zone is isolated, but the Availability Zones in a Region are connected through low-latency links. AWS provides you with the flexibility to place instances and store data within multiple geographic regions as well as across multiple Availability Zones within each AWS Region. Each Availability Zone is designed as an independent failure zone. This means that Availability Zones are physically separated within a typical metropolitan region and are located in lower risk flood plains (specific flood zone categorization varies by AWS Region). In addition to discrete uninterruptable power supply (UPS) and onsite backup generation facilities, they are each fed via different grids from independent utilities to further reduce single points of failure. Availability Zones are all redundantly connected to multiple tier-1 transit providers
Types of shells$
Bourne Shell OS Type = Default shell in Solaris 10/later version Program Location Path = /usr/bin/sh or /bin/sh or /sbin/sh Bash Shell (Bourne Again Shell) OS Type = Default in Linux, can be accessed in Solaris Program Location Path = /usr/bin/bash or /bin/bash or /sbin/bash Korn Shell OS Type = Default in earlier versions of Solaris Ex.) Solaris 9 Program Location Path = /usr/bin/ksh or /usr/ksh or /sbin/ksh C Shell OS Type = Multi-platform shell used by developers to compile codes. Program Location Path = /usr/bin/csh or /usr/csh or /sbin/csh
# - Command Prompt
Commands are issued at the command prompt of the terminal
5. Explain the difference between the AWS Iaas, Paas, and Saas
IAAS (Infrastructure as a Service) = provides you with the highest flexibility & management control over your IT resources and is most similar to existing IT resources that many departments & developers are familiar with today. PAAS (Platform as a Service) = Removes the need for organizations to manage the underlying infrastructure (usually hardware & operating systems) and allow you to focus on the deployment and management of your applications. This helps you be more efficient as you don't need to worry about resource procurement, capacity planning, software maintenance, patching, or any of the other undifferentiated heavy lifting involved in running your application. SAAS (Software as a service) = provides you with a completed product that is run & managed by the service provider. In most cases, people referring to Software as a Service are referring to end-user applications. With a SaaS offering you do not have to think about how the service is maintained or how the underlying infrastructure is managed: you only need to think about how you will use that particular piece of software. A common example of a SaaS application is web-based email where you can send and receive email without having to manage feature additions to the email product or maintaining the servers and operating systems that the email program is running on.
What is cloud computing?
It is the on-demand delivery of compute power, database storage, applications and other IT resources through a cloud service platform via the internet
Centos 6 installation
Live CD = The OS system is built in the ISO image. People usually use live cds for testing cause it is virtual, it isn't installed on their system. To install, - select usb tablet because mouse goes all over the place -settings>systems>pointing devices (to make changes in your system, it must be powered off - interrupt system at bootup with task bar -" yes, discard any data" - "write changes to disk" - Once installed, power off system > settings > uncheck optical disk.
Console Login $
Login to the physical or local server from the GUI or Terminal
Terminal Login $
Login to the server remotely via a terminal emulator like putty.
Installing Solaris 10 Server
Name: Schoolsol 27 Version: 10/09 & later (32-bit) Ram: 1500 Storage: 30 GB Bridge & insert CD ROM -Select start-up disk - chose the iso image (if mouse gets stuck, hit right ctrl key) (if you don't have F2 key, use "esc" & "2" key) -Click inside white box & hit enter, if you miss this, you must start from scratch. -Select "networked" -use DHCP - "yes" -enable remote service "yes" -uncheck register -Once it reboots, turn off system & remove ISO Image
What DNS record is involved in the command (#nslookup 8.8.8.8)
Pointer Record (PTR)
Joining the NOS to the Domain
Requirements: 1. DC must be talking to LAN systems 2. The NOS's DNS server must be the IP address of the DC. FunFact: -be proactive, fix a ticket then look for other problems.
First thing you do on a standard server to convert it to a domain controller $
Run dcpromo
Command Terminal Access
The command is a platform used to issue commands to the system.
The Wildcat option "*"
Used to arrange the output of a command in a specific pattern 1. Display everything that starts with a d $ls d* 2. Display everything that starts with a "t" and ends with an "e" $ls t*e 3. Display an output that has an e in the middle $ls *e*
The touch command
Used to create files 1. Create a file called "class27" in your pwd $touch class27 $ls (to verify) 2.Create the file f1 f2 f3 f4 in your pwd all at once $touch f1 f2 f3 f4 $ls (to verify)
The move command (mv)
Used to cut & paste as well as to rename component 1. Move the directory unix27 from your pwd into the directory d27a $mv unix27 d27a $ls (to verify that unix27 is no longer in our pwd) $ls d27a (to verify that unix27 is now in the directory d27a) 2. Change the name of the directory d27a to dir27a $mv d27a dir27a $ls (to verify)
The remove command (rm)
Used to delete components -$rm <file> -$rm -r <directory> -$rm -R <files + directories> -$rm -f <file> (force remove) -$rm -rf <directory> -$rm -Rf <files + directories> -f = force remove. (Will also prevent the remove process from becoming interactive in linux) 1. Delete the file f1 from your pwd $rm f1 $ls (to verify) 2. Delete the directory d1 from your pwd $rm -r d1 $ls (to verify) 3. Delete the content of the directory dir27a $rm -R dir27a/* $ls dir27a (to verify) 4.Delete the empty directory dir27a $rm -r dir27a OR $rmdir dir27a (rmdir is used to delete empty directories) 5. Delete all the files & directories that end with .temp #rm -R /*.temp If you do #rm -R /* , you will delete root which will crash the Solaris Server
The su command
Used to switch the role of a user to another user While logged in as root, switch users from root to student using the following command - #su student -Root account has admin rights and can su to the profiles in any user in the system without being prompted for a password. To exit out the student account & back to root - $exit To have the root account assume the role of student & will also move into the profile or home of the student. - #su - student To have the root account assume the role of student, but will not move into the home of student. - #su student
NAT (Network Address Translation)
Used to translate traffic from one network to another so that systems from different networks can communicate with each other.
List and explain the 6 different advantages of the AWS cloud
• Trade capital expense for variable expense - Instead of having to invest heavily in data centers and servers before you know how you're going to use them, you can pay only when you consume computing resources, and pay only for how much you consume . • Benefit from massive economies of scale - By using cloud computing, you can achieve a lower variable cost than you can get on your own. Because usage from hundreds of thousands of customers is aggregated in the cloud, providers such as AWS can achieve higher economies of scale, which translates into lower pay as-you-go prices. • Stop guessing capacity - Eliminate guessing on your infrastructure capacity needs. When you make a capacity decision prior to deploying an application, you often end up either sitting on expensive idle resources or dealing with limited capacity. With cloud computing, these problems go away. You can access as much or as little capacity as you need, and scale up and down as required with only a few minutes' notice. • Increase speed and agility - In a cloud computing environment, new IT resources are only a click away, which means that you reduce the time to make those resources available to your developers from weeks to just minutes. This results in a dramatic increase in agility for the organization, since the cost and time it takes to experiment and develop is significantly lower . • Stop spending money running and maintaining data centers - Focus on projects that differentiate your business, not the infrastructure. Cloud computing lets you focus on your own customers, rather than on the heavy lifting of racking, stacking, and powering servers. • Go global in minutes - Easily deploy your application in multiple regions around the world with just a few clicks. This means you can provide lower latency and a better experience for your customers at minimal cost.