A+ Guide to IT Technical Support (Hardware and Software) (MindTap Course List)
9th Edition
ISBN: 9781305266438
Author: Jean Andrews
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 20, Problem 1TC
Explanation of Solution
Given:Â
The user wants to manage the FTP server that is installed on an Ubuntu Server.
The very large log file named vsftpd.log created by the Ubuntu server.
To find: The command which is suitable for searching the log file for the activity of the user Charlie.
Solution:
The command sudo grep “charlie� /var/log/vsftpd...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
You are managing an FTP server installed in Ubuntu Server. The server has created a very large log file, vsftpd.log. Which command is appropriate to search the log file for activity of the user charlie?
sudo cat /var/log/vsftpd.log
grep “charlie” /var/log/vsftpd.log
sudo grep “charlie” /var/log/vsftpd.log
cat /var/log/vsftpd.log
For this lab, you will write a shell script called nethelper.sh that:
1. Reads in a list of hosts from a host file that is passed in as a parameter
2. Repeatedly, until the user selects quit (q), ask the user if the user wants to ping a host or look up a hosts DNS name
3. Once the user has selected an action, prompts the user for which host and then applies the action. Note that for the ssh action, the script must also ask the user for the user name that will be used to log into the host.
Step 1
To accomplish step 1 above (reading in a list of hosts from a file), you will write a function called read_hosts. Functions in bash scripts have the following syntax: function name { # function body goes here }
You can put any bash syntax inside the function as the function body. Also, note that the parameters to a function act like the parameters passed in at the command line. In other words, the parameters to the function are place in variable named $1, $2, and so on.
So, how do you read the…
Modify the server code so that it prints the client’s IP and port number when it receive a new connection.
from socket import *
serverName = 'localhost'
serverPort = 12000
clientSocket = socket(AF_INET, SOCK_STREAM)
clientSocket.connect((serverName,serverPort))
sentence = input('Input lowercase sentence:')
byteToSend = str.encode (sentence)
clientSocket.send(byteToSend)
modifiedSentence = clientSocket.recv(1024)
print('From Server:', modifiedSentence)
clientSocket.close()
from socket import *
serverPort = 12000
serverSocket = socket(AF_INET,SOCK_STREAM)
serverSocket.bind(('',serverPort))
serverSocket.listen(1)
print ('The server is ready to receive')
while 1:
connectionSocket, addr = serverSocket.accept()
sentence = connectionSocket.recv(1024)
capitalizedSentence = sentence.upper()
connectionSocket.send(capitalizedSentence)
connectionSocket.close()
from socket import *
serverName = 'localhost'
serverPort = 12000
clientSocket = socket(AF_INET,…
Chapter 20 Solutions
A+ Guide to IT Technical Support (Hardware and Software) (MindTap Course List)
Knowledge Booster
Similar questions
- The netstat programme, available for Linux and Windows, provides a list of active network connections. Describe how to use this command to identify whether a web page is not terminating connections or, if connection pooling is being used, is not returning connections to the pool. You may do this by looking at whether or not the connection is being returned to the pool. There is a possibility that connection pooling will not immediately terminate the connection.arrow_forwardOn servers with Linux operating system, access logs are kept under which of the following directories by default?A) /var/log/B) /var/log/auth/C)/log/D)/log/auth/ Which of the following would an attacker prefer to run operating system-level code with MSSQL?A) MSSQL cannot run code at the operating system level.B) MSSQL agentC) xp_cmdshellD) There are no options. As a network administrator, you want to reduce the attack surface on your systems. Which of the following helps?A) Creating shared folderB) Make sure that only the necessary services are activeC) To record access activitiesD) monitor network traffic Which of the following products can an institution prefer to use if its antivirus software is up-to-date on the computers in its network?A) FirewallB) DLPC) Web ProxyD) NAC When John enters the mobile banking app on his smartphone, he sees his account balance is decreasing. What would it be better for John to do first to fix this situation?A) Closing and reopening the mobile…arrow_forwardThere are two files, PingProgram.docx and GetHostByName.docx. PingProgram needs an IP address to work, and doesn’t use URLs, as per the example below. GetHostByName will return an IP address given a URL, also shown below. GetHostByName takes in a URL and a port number. Rewrite PingProgram to do the following: 1.Accept either a URL or an IP address as an input. 2.Ping the requested server 3 times instead of once. 3.Present all 3 round trip times, along with an average round trip time.arrow_forward
- Can you run two client programs on a same host? Try it out, and explain how the server differentiate the two different processes (both running the same client code)? from socket import * serverName = 'localhost' serverPort = 12000 clientSocket = socket(AF_INET, SOCK_STREAM) clientSocket.connect((serverName,serverPort)) sentence = input('Input lowercase sentence:') byteToSend = str.encode (sentence) clientSocket.send(byteToSend) modifiedSentence = clientSocket.recv(1024) print('From Server:', modifiedSentence) clientSocket.close() from socket import * serverPort = 12000 serverSocket = socket(AF_INET,SOCK_STREAM) serverSocket.bind(('',serverPort)) serverSocket.listen(1) print ('The server is ready to receive') while 1: connectionSocket, addr = serverSocket.accept() sentence = connectionSocket.recv(1024) capitalizedSentence = sentence.upper() connectionSocket.send(capitalizedSentence) connectionSocket.close() from socket import * serverName =…arrow_forwardThe netstat command (available on Linux and on Windows) shows the active network connections on a computer. Explain how this command can be used to find out if a particular web page is not closing connections that it opened, or if connection pooling is used, not returning connections to the connection pool. You should account for the fact that with connection pooling, the connection may not get closed immediately.arrow_forwardYou are examining an Apache server, and see the following configuration: <VirtualHost *:443>ServerName webserverDocumentRoot /var/www/webserverSSLEngine onSSLCertificateFile /etc/ssl/certs/webserver.crtSSLCertificateKeyFile /etc/ssl/private/webserver.key</VirtualHost> What would you expect the hostname of the computer to be?arrow_forward
- Recall that only Standard Output can be sent across a pipe to another command. Usingthe information presented in this chapter, how could you send Standard Error across thepipe in the following command?ls /etc/hosts /etc/h | tr h Harrow_forwardHow would you use the "tail" command to watch the end of the log file/var/log/http/access_log as lines are appended to it in real time?arrow_forwardConfigure Manual IP address on your Linux Virtual Machine by modifying the network script file for the enp0s3 interface as follows: IPv4: 192.168.x.1 Netmask: 255.255.255.0 Gateway: 192.168.x.254 DNS: 192.168.x.1 X=the last 2 digits of your student ID. If the digits are 01 then use 101 or 02 use 102 etc. Capture the updated contents of the ifcfg-enp0s3 script file. Paste them in the following space: Display the history of commands in the terminal. Capture the screen and paste the outputarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- A+ Guide To It Technical SupportComputer ScienceISBN:9780357108291Author:ANDREWS, Jean.Publisher:Cengage,LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.Computer ScienceISBN:9781337569798Author:ECKERTPublisher:CENGAGE L
A+ Guide To It Technical Support
Computer Science
ISBN:9780357108291
Author:ANDREWS, Jean.
Publisher:Cengage,
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:9781337569798
Author:ECKERT
Publisher:CENGAGE L