System Administration and IT Infrastructure Services
This courses is sub-divided into 6 weeks of study program, which has 5 sub-topics and a final project.
This courses is sub-divided into 6 weeks of study program, which has 5 sub-topics and a final project.
The field in IT that’s responsible for maintaining reliable computer systems in a multi-user environment.
IT Infrastructure encompasses the software, the hardware, network, services required for an organization to operate in an enterprise IT environment.
Sysadmins work in the background to make sure the company’s IT infrastructure is always up and running.
In large companies, sysadmin can be split-up into:
Network Administrators
Database Administrators
Software or a machine that provides services to other software or machines.
Servers include:
The servers can be of three of the most common types in terms of their space efficiency:
Keyboard, Video, and Mouse (KVM) is an industry standard hardware device for connecting directly to the servers.
A facility that stores hundreds, if not thousands, of servers.
In other responsibilities, Sysadmins have is managing users and hardware.
There are four stages of hardware life cycle
To affectively update a fleet of hardware, you set up a Batch update, once every month or so, depending upon company policies.
Good practice is to install security and critical bug fixes routinely.
Not only do sysadmins in a small company work with using computers, they also have to deal with printers and phone, too.
Whether your employees have cellphones or desk phones, their phone lines have to be setup.
Other hardware generally used in companies is:
Sysadmins might be responsible for making sure printers are working or, if renting a commercial printer, they have to make sure that someone can be on site to fix it.
Setting up businesses account with vendors like **Hewlett Packard, Dell, Apple, etc. is usually beneficial since they generally offer discounts for businesses.
While working in an organization, sysadmins have to constantly troubleshoot and fix issues on machines.
You need to prioritize the issues all the time.
As a sysadmin, you need to have some recovery plan for companies critical data and IT infrastructure in case of a critical failure.
script
Command used to record a group of commands as they’re being issued on LinuxStart-Transcript
is an equivalent command on WindowsIn the case of script
you can call it like this:
script session.log
This writes the contents of your session to the session.log file. When you want to stop, you can write exit or press CTRL+D.
The generated file will be in ANSI format, which includes the colors that were displayed on scree. In order to read them, you can use CLI tools like, ansi2txt or ansi2html to convert it to plain text or HTML respectively.
In the case of Start-Script
, you can call it like this:
Start-Script -Path <drive>:\Transcript.txt # File name can be anything.
To stop recording, you need to call Stop-Transcript
. The file created is a plain text file where the commands executed, and their outputs, are stored.
Reverting to the previous state is called a rollback.
The parts of the infrastructure where a certain service is executed and served to its users.
A virtual machine running the same configuration as the production environment, but isn’t actually serving any users of the service.
This machine will be exactly the same as a production machine, but won’t receive any traffic from actual suers until you enable it to do so.
There is no point of having test/secondary servers, when nobody cares about the downtime.
So, it’s very important to assess the risk before going forward to invest in the backup plans.
In general, the more users your service reaches, the more you’ll want to ensure that changes aren’t disruptive.
The more important your service is to your company’s operations, the more you’ll work to keep the serve up
Creating a roadmap to retrace the steps that led the user to an unexpected outcome.
When looking for a Reproduction case, there are three questions you need to look for:
After applying your fix, retrace the same steps that took you to the bad experience. If your fix worked, the expected experience should now take place.
You can use Cloud Infrastructure Services or IaaS, if you don’t want to use own hardware. Some common IaaS providers are:
Networks can be integrated into an IaaS
But in recent years, Network as a Service or NaaS has emerged.
Every company needs, some email service, word processor, ppt makers, CMS, etc. Software as a Service or SaaS can handle it for you.
Some companies have a product built around a software application. In this case, there are some things that software developers need to be able to code, build and shape their software.
The last IT Infrastructure service we’ll discuss is the management of users, access, and authorization. A directory service, centralizes your organization’s users and computers in one location so that you can add, update, and remove users and computers. Some popular directory services are:
The directory services can be directly deployed in the cloud via Directory as a Service or DaaS.
Regular operating systems that are optimized for server functionality.
Advantages:
Limitations:
It allows you to boot into software available on the network.
One of the oldest network protocols
You can use Public NTP server, or deploy your own if you have a fleet of hundreds and thousands of computers.
An internal network inside a company; accessible if you’re on a company network.
Acts as an intermediary between a company’s network and the Internet.
Maps human-understandable names to IP addresses.
To check if website accepts ping requests
ping google.com
To verify if your DNS is giving you correct address for <google.com>
nslookup google.com
Remember that when a DNS query is performed, your computer first checks the host file. To access a host file:
sudo vim /etc/hosts
To check if NTP daemon running on a system
timedatectl
If there is a change of more than 120ms, the NTP daemon will not adjust for the change.
Stopping and starting the NTP service manually, will adjust the clock to correct settings.
Restart first stops and then start the service.
Here, for example, we will deal with Windows Update Service
To check the status of the service:
Get-Service wuauserv # Short hand for Windows Update Service
To get more information about the service:
Get-Service wuauserv | Format-List *
To stop service (Admin required):
Stop-Service wuauserv
To start a service (Admin required):
Start-Service wuauserv
To list all services running in the system:
Get-Service
**Same actions can be performed via Service Management Console in GUI.
Most services are enabled as you install them, they are default services ship with the program itself.
The configuration files for the installed services are located in the /etc
directory.
Here we will use the example of ftp client.
After installing ftp client vsftpd
, it will start the service automatically.
We can start ftp client
lftp localhost
To enable anonymous ftp logins, we can edit the configuration file in /etc/vsftpd.conf
sudo service vsftpd reload
A ftp client program that allows us to connect to a ftp server.
The service re-reads the configuration without having to stop and start.
Here as an example we will use Internet Information Services, the feature offered by Windows to serve the web pages.
First, Turn the Feature ON and OFF in the settings to first enable it.
To Feature ON/OFF from the CLI
Install-WindowsFeature Web-WebServer,Web-Mgmt-Tools -IncludeAllSubFeature
Then we can add and remove IIS in the server manager, where IIS tab is now available after applying the above changes.
A program that provides DNS, DHCP, TFTP, and PXE services in a simple package.
To install it:
sudo apt install dnsmasq
It immediately gets enabled with basic functionality, provides cache for DNS queries. This means you can make DNS request to it, and it’ll remember answers, so your machine doesn’t need to ask an external DNS server each time.
To check this functionality, we’ll use dig
command, which lets us query DNS servers and see their answers:
dig www.example.com @localhost
Part after @
sign specifies which DNS server to use for query.
To see what’s happening in the background, we can run dnsmasq
in the debug mode.
First stop the service:
sudo service dnsmasq stop
Now, run it in debug mode:
sudo dnsmasq -d -q
Now open a second console, and run dig
command again, dnsmasq
console running with flags -d
(debug), q
(query logging)
A DHCP server is usually set up on a machine or a device that has a static IP address configured to the network interface which is being used to serve the DHCP queries. That interface is then connected to the physical network that you want to configure through DHCP, which can have any number of machines on it. In real life, the DHCP server and the DHCP client typically run on two separate machines.
For this example, we’ll use a single machine
In this machine, we have an interface called eth_srv, that’s configured to be the DHCP server’s interface.
We also have an interface called eth_cli, which is the interface that we’ll use to simulate a client requesting an address using DHCP. This interface doesn’t have an IP configured yet.
So, I’m going to type in
ip address show eth_cli
We can see that this interface doesn’t have an IPV4 address configured. We will change this by using our DHCP server. To do this, we need to provide additional configuration to dnsmasq. There are lots of things we can configure. We’re going to use a very basic set of options. Let’s look at the configuration file.
cat DHCP config.
The interface option tells dnsmasq that it should listen for DHCP queries on the eth_srv interface. The bind interfaces option tells it not to listen on any other interfaces for any kind of queries. This allows us to have more than one dnsmasq server running at the same time, each on its own interface. The domain option tells the clients, the networks’ domain name and will be used for querying host names. Then, we have two different DHCP options, which are additional information that will be transmitted to DHCP clients when the IP is assigned. In this case, we’re telling clients what to configure as a default gateway and which DNS servers should be used. There are a lot more options that we can set, but these two are the most common ones.
Finally, we configure the DHCP range. This is the range of IP addresses that the DHCP server can hand out. Depending on your specific setup, you may want to reserve some addresses in your network for machines that need to have a static address. If you don’t plan to do that, you can make the range larger, but make sure you don’t include the address of the DHCP server itself. The last value in the DHCP range Line is the length of the lease time for the IP address. In this case, it’s 12 hours, which means that once an address is assigned to a machine, it will be reserved for that machine for those 12 hours. If the lease expires without the client renewing it, the address can be assigned to a different machine.
Let’s tell dnsmasq to start listening for queries using this config.
sudo dnsmasq -d -q -c dhcp.conf
We can see in the output that dnsmasq is listening for DHCP queries on the eth_srv interface with the options that we set in our configuration file. Now, let’s run a DHCP client on a second terminal.
sudo dhclient -i eth_cli -v
We’re using dhclient which is a very common DHCP client on Linux. We’re telling it to run on the eth_cli interface, and we’re using the -v flag to see the full output of what’s happening.
ip address show eth_cli
Our eth_cli interface has successfully acquired an IP address.
Bind DNS: https://www.isc.org/downloads/bind/ ↩︎
PowerDNS: https://www.powerdns.com/ ↩︎
Erl-DNS: https://github.com/dnsimple/erldns ↩︎
Provide a platform for developers to code, build, and manage software applications.
Services that employees use that allow them to do their daily job functions.
Major software services are
Some instant chat communication services are:
Internet Chat relay (IRC)
Paid for options: HipChat and Slack
IM protocols: XMPP or Extensible Messaging and Presence Protocol
Domain name for company
Some email protocols are:
It first downloads the email from the server and onto your local device. It then deletes the email from the email server. If you want to retrieve your email through POP3, you can view it from one device.
Allows you to download emails from your email server onto multiple devices. It keeps your messages on the email server.
It is an only protocol for sending emails.
When considering software licenses, it’s important to review the terms and agreements.
Software used has consumer won’t be the same as the software used as business.
Different protocols for managing the security of the online services
The secure version of HTTP, which makes sure the communication your web browser has with the website is secured through encryption.
To enable TLS, so a website can use HTTP over TLS, you need to get an SSL certificate for Trust authority.
Only few file systems are cross-compatible. Like FAT32.
Network File System (NFS), allows us to share files over a network, cross-compatible.
NFS is even through cross-compatible, but there are some compatibility issues on Windows.
Even your fleet is mostly Windows, you can use Samba, though Samba is also cross-platform.
An affordable solution is to use Network Attached Storage or NAS. They are optimized for network storage and comes with the OS stripped down and optimized for file transfer and storage.
Stores and serves content to clients through the Internet.
Some server software:
Allow us to store, query, filter, and manage large amounts of data.
Common databases:
There is a specialized field within IT that handles databases:
HTTP status codes are of great help for troubleshooting web servers errors.
Knowing common HTTP status codes comes handy for fixing website errors.
HTTP status Codes are codes or numbers that indicate some sort of error or info messages that occurred when trying to access a web resource.
They tell us more than just errors. They can also tell us when our request is successful, which is denoted by the codes that begin with 2xx.
A 404 error indicates that the URL you entered doesn’t point to anything.
The software is already pre-configured and the user isn’t deeply involved in the cloud configuration.
You’re hosting your own services in the cloud. You need to decide how you want the infrastructure to look, depending on what you want to run on it.
A geographical location containing a number of data centers.
Cloud services provided to you by a third party.
When your company owns the services and the rest of your infrastructure – whether on-site or in a remote data center.
A mixture of both private and public clouds.
Let’s say you have a web server providing a website to a client. In a typical setup for this kind of service running in a cloud, a number of virtual machines will be serving this same website using Load balancers.
To make sure servers running properly, you can set:
Ensures that each VM receives a balanced number of queries.
It allows the service to increase or reduce capacity as needed, while the service owner only pays for the cost of the machines that are in use at any given time.
“Contains a lookup service that provides mapping between network resources and their network addresses.”
A sysadmin will be responsible for directory server:
The stored directory data can be copied and distributed across a number of physically distributed servers, but still appear as one, unified data store for querying and administrating.
Useful for organizing data and making it searchable for an organization.
Directory services became an open network standard for interoperability among different vendors.
Directory Access Protocol or DAP
Directory System Protocol or DSP
Directory Information Shadowing Protocol or DISP
Directory Operational Bindings Management Protocol or DOP The most popular of these alternatives was:
Lightweight Directory Access Protocol or LDAP
The popular industry implementation of these protocols are:
“A central service that provides instructions to all the different parts of the company’s IT infrastructure.”
They’re super powerful configuration management, and automation software tools like:
“Used to access information in directory services, like over a network.”
The most famous one which use LDAP:
LDIF (LDAP data Interchange Format) has the following fields
dn
(distinguished name)This refers to the name that uniquely identifies an entry in the directory.
dc
(domain component)This refers to each component of the domain.
ou
(organizational unit)This refers to the organizational unit (or sometimes the user group) that the user is part of.
cn
(common name)This refers to the individual object (person’s name; meeting room; recipe name; job title; etc.) for whom/which you are querying.
There are three ways of LDAP authentication:
The common SASL authentication technique is Kerberos.
A network authentication protocol that’s used to authenticate user identity, secure the transfer of user credentials, and more.
The native directory service for Microsoft Windows.
Local user accounts and security groups are managed by the **Security Accounts Manager (SAM) on a local computer.
There are three group scopes:
Passwords are stored as cryptographic hash.
If there’s more than one person who can authenticate using the same username and passwords, then auditing become difficult or even impossible.
A computer not part of the AD is called a WorkGroup computer.
Settings > System and Security > System > Computer name, domain, and workgroup settings
From CLI:
Add-Computer -DomainName 'example.com' -Server 'dc1'
To get domain functional level:
Get-AdForest
Get-AdDomain
Functional levels determine the available AD Domain Service (AD DS) domain or forest capabilities. They also determine which Windows Server OS you can run on domain controllers in the domain or forest.
A set of policies and preferences that can be applied to a group of objects in the directory.
OU
will have that policy applied.GPO
can contain computer configuration, user configuration, or both.gpms.msc
, to change GPOs.Settings that are reapplied every few minutes, and aren’t meant to be changed even by the local administrators.
Settings that, in many cases, are meant to be a template for settings.
A hierarchical database of settings that Windows, and many Windows applications, use for storing configuration data.
Always make backup before creating new policies or editing existing ones.
When a computer is processing GPO that apply to it, all of these policies will be applied in Precedence rules.
When GPOs collide, they’re applied:
Site → Domain → OU
(Applied from least specific to the most specific)
One of the most common issues you might encounter is when a user isn’t able to log in to their computer, or isn’t able to authenticate to the Active Directory domain.
Resolve-DNSName -Type SRV -Name _ldap._tcp.dc._msdcs.example.com
A common issue that you might have to troubleshoot is when a GPO-defined policy or preference fails to apply to a computer.
gpupdate /force /sync
$env:LOGONSERVER
To know why a particular isn’t applying to a computer, generate a RSOP (Resultant Set of Policy) report.
gpresult /R
To get the full report:
gpresult /H test.html
The mobile OS takes MDM profiles or policies that contain settings for the device. You can use MDM to do a bunch of things:
MDM policy settings are specific to each OS. Those policies can be created and distributed Enterprise mobility management (EMM).
A factory reset that you can trigger from your central MDM, rather than having to do it in person on the device.
OpenLDAP is an open source implementation of Lightweight Directory Access Protocol (LDAP)
To install it on Debian and Debian-based distros:
sudo apt install slapd ldap-utils
Then we’ll reconfigure the slapd
package:
sudo dpkg-recofigure slapd
Now you have a running ldap
server.
To get Web Interface:
sudo apt install phpldapadmin
The web server is now configured to serve the application, but we need to make additional changes. We need to configure phpldapadmin
to use our domain, and not to autofill the LDAP login information.
sudo vim /etc/phpldapadmin/config.php
Look for the line that start with $ servers->setValue('server','name
$server->setValue('server','name','Example LDAP')
Next, move down to the $servers->setValue('server','base'
line.
$servers->setValue('server','base', array('dc=example,dc=com'));
Now find the login bind_id
configuration line, and comment it out with #
#$servers->setValue('login','bind_id','cn=admin,dc=example,dc=com');
The last thing that we need to adjust is a setting that controls the visibility of some phpLDAPadmin warning messages. By default, the application will show quite a few warning messages about template files. These have no impact on our current use of the software. We can hide them by searching for the hide_template_warning
parameter, uncommenting the line that contains it, and setting it to true:
$config->custom->appearance['hide_template_warning'] = true;
Now login to Web-Interface
https://example.com/phpldapadmin
Takes the input of an LDIF file2 and adds the context of the files.
Modifies an existing object.
Will remove the object that the LDIF file refers to.
Will search for entries in your directory database.
How to Configure OpenLDAP Web-Interface: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-openldap-and-phpldapadmin-on-ubuntu-16-04 ↩︎
For information about how to use LDIF files to make changes to an OpenLDAP system: https://www.digitalocean.com/community/tutorials/how-to-use-ldif-files-to-make-changes-to-an-openldap-system ↩︎
“The process of trying to restore data after an unexpected even that results in data loss or corruption.”
How you go for data recovery depends on few factors:
When an unexpected even occurs, your main objective is to resume normal operations asap, while minimizing the disruption to business functions.
The best way to be prepared for a data-loss event is to have a well-thought-out disaster plan and procedure in place.
A Postmortem is a way for you to document any problems you discovered along the way, and most importantly, the ways you fixed them so, you can make sure they don’t happen again.
Absolutely necessary data should be backed up.
Backed up data as well as, data in transit for backup, both should be encrypted.
Too many backup solutions are there, some of them are:
A file transfer utility that’s designed to efficiently transfer and synchronize files between locations or computers.
Apple’s backup solution, that can restore entire snapshot or individual files.
Backup and restore is used to back up files as well as, system snapshots in the disk.
This tool can do following tasks:
Disaster recovery testing should be done every year or so.
Should be documented and accessible so that anyone with the right access can restore operations when needed.
Ways to Perform Regular Backups:
It’s a good practice to perform infrequent full backups, while also doing more frequent differential backups.
A method of taking multiple physical disks and combining them into one large virtual disk.
For user backups:
“A collection of documented procedures and plans on how to react and handle an emergency or disaster scenario, from the operational perspective.”
Any procedures or systems in place that will proactively minimize the impact of a disaster.
Meant to alert you and your team that a disaster has occurred that can impact operations.
Those enacted after a disaster has occurred.
No fit for all plan, there is a lot to go into a disaster recovery plan.
Designing a Disaster Recovery Plan:
Allows you to prioritize certain aspects of the organizations that are more at risk if there’s an unforeseen event.
“A Postmortem is a way for you to document any problems you discovered along the way, and most importantly, the ways you fixed them so, you can make sure they don’t happen again.”
Typical postmortem report consists of:
You’re doing systems administration work for Network Funtime Company. Evaluate their current IT infrastructure needs and limitations, then provide at least five process improvements and rationale behind those improvements. Write a 200-400 word process review for this consultation. Remember, there’s no right or wrong answer, but make sure to provide your reasoning.
Network Funtime Company is a small company, that builds open-source software.
The Company is made up of 100 employees:
The company should hire an IT Support specialist, who will take care of:
The company should move to OpenLDAP or Active Directory for centralized passwords and permissions management and recovery.
The HR should be responsible for his/her tasks instead of providing IT Support, Hardware management, and Employees’ software installation and setup.
Hiring an IT support specialist:
Centralized management:
You’re doing systems administration work for W.D. Widgets. Evaluate their current IT infrastructure needs and limitations, then provide at least five process improvements and rationale behind those improvements. Please write a 200-400 word process review for this consultation. Remember, there’s no right or wrong answer, but make sure to provide your reasoning.
The company is in the business of selling widgets. There are mostly sales persons in the company.
The company size is 80–100 people.
The company should hire new talent for IT Support related stuff.
The automation for the following should be done:
A centralized management of the data is required:
The company should move some of their services to the cloud, like:
Hiring new tech talent:
The automation will make sure:
The cloud will make the company:
The centralized management:
You’re doing systems administration work for Dewgood. Evaluate their current IT infrastructure needs and limitations, then provide at least five process improvements and rationale behind those improvements. Please write a 200-400 word process review for this consultation. Remember, there’s no right or wrong answer, but make sure to provide your reasoning.
A small local non-profit of 50 employees.
The computer should be purchased directly from vendors:
The company should move their email sever to the cloud:
Should use some cloud-based solution for internal instant chats:
To improve the customer ticketing system:
For the backups: