admin tools Flashcards

1
Q

What tool is used to install software?

A

rpm - Red hat package manager

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what web site provides more details about rpm?

A

rpm.org

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

rpm option for applying upgrades

A

–upgrade

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

uninstall a software package

A

rpm –erase

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

find out what is installed

A

rpm -qa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

find out where a software package is installed

A

get the full name of the package you are lookng for:

rpm –query –all |grep <searchtoken></searchtoken>

List all the files associated with the package install

rpm -ql rpm -q <name></name>

to get a complete listing of all apps installed

rpm –query –all

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what command would provide a detailed list of all install applications?

A

rpm -qig Applications/System

  • g show all groups for the provided string
  • i show detailed information about each
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what tells you the DHCP server being used by a linux workstation?

A

cat /var/lib/dhclient/dhclient-eth0.leases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what command will renew a DHCP lease?

A

dhclient -r

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what authentication schemes are available?

A

using PAM (Pluggable Authentication Modules) the following can be used:

flat files

NIS

LDAP

Samba

Kerberos

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the typical partitions on a linux server?

A

/ or root

/boot

/usr (program app files)

/home (user docs)

/var (system procs and logs)

/tmp

/swap (virtual memory)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

how big should the swap partition be?

A

The swap file for virtual storage should be double the physical memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what partition is /dev/sdb4 ?

A

the 4th partition on the disk with ID 2 (b)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is used to install or remove applications?

A

Red Hat Package Manager RPM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

how do you get a list of configuration files associated with an application?

A

rpm -qc <name></name>

rpm -qc bash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what command will show all apps installed with all details?

A

rpm -q -i –all

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

how do you get a list of installed shells?

A

rpm -qa –queryformat ‘%10{name} %20{GROUP}\n’ |grep -i shells

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

what is stored in the passwd file

A

login

encrypted password

UID

default GID

name

home directory

login shell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

what appears in the passwd file if shadow passwords are being used?

A

an x appears in the encrypted password field in /etc/passwd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

what command is used to change the system run level?

A

init { 0 1 2 3 4 5 6 }

0 — Halt

1 — Single-user text mode

2 — Multiuser but no NFS

3 — Full multi-user text mode

4 — Not used (user-definable)

5 — Full multi-user with X11

6 — Reboot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

where are the default environment configuration template files stored?

A

/etc/skel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

what file holds a list of available shells?

A

/etc/shells

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

what are the fields in the shadow file?

A

Login name

encrypted password

last passwd change

days until change allowed

days before change required

days warning for expire

days before account inactive

days before account disabled

reserved field

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

what are the fields in the group file?

A

group name

group password
 (optional: if set allows users to join group)

group ID

group members
(comma separated list)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

what are the user management command line tools?

A

useradd

userdel

usermod

groupadd

groupdel

groupmod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

what sh script command is used to process the files of a directory?

A

assuming the directory name is in the variable $SCRIPTS:

for file in ${SCRIPTS}/* do

 echo ${file}

 blah . . . 

 blah . . . 

done

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

what sh command loads the current directory location value into a variable?

A

SCRIPTS=pwd;export SCRIPTS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

what file configures dhcp daemon?

A

/etc/dhcpd.conf

and any other files which the “include” statement specifies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

what command checks the dhcp configuration file?

A

/etc/rc.d/init.d/dhcpd configtest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

what cisco command enables a DHCP helper to allow DHCP requests to pass to the next network?

A

ip helper-address 123.456.789.1

(the ip address of the DHCP server on the other network)

must be a config entry for the router interface facing the network where the DHCP server is located.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

where does a DHCP server store information about clients?

A

/var/lib/dhcpd/dhcpd.leases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

what does the service command actually do?

A

it executes the specified service init script from the /etc/init.d directory with the optional action parameter supplied. Such as:

service iscnamed status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

what command will list all services?

A

service –status-all

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

where are the service init script stored?

A

/etc/init.d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

what command will restart a service?

A

service <service_script_name> --full-restart</service_script_name>

OR

service <service_script_name> restart</service_script_name>

which will issue a stop and then start command to the service init script

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

what command will show the configured status of a service at each run level?

A

chkconfig –list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

what command can change or manage how a service is started?

A

chkconfig –add <name></name>

chkconfig –del <name></name>

chkconfig <name> (returns true if the service is configured to start in the current runlevel)</name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

what is auditd?

A

a daemon that provides the Linux Auditing System.

It provides kernel-resident logging of system calls and user space tools to collect and view the Linux system logs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

what command will show a tree of processes and their children?

A

pstree -A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What command is used to add or remove modules from the kernel?

A

mobprobe

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

what command will show the modules present in the kernel?

A

lsmod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

what command can be used to copy a file between two hosts?

A

rcp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

what command can be used to change the current user’s login shell?

A

chsh

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

what command can be used to change a file attributes and do so recursively?

A

chattr -R

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

what command can be used to split a file into specific sizes?

A

csplit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

what command can be used to show a file’s classification or type?

A

file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

what command will show a hexidecimal format of a file?

A

hexdump -C <filename></filename>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

what command can be used to view the contents of a log file as it grows?

A

tailf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

where are the PAM modules stored?

A

/lib/security

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

where are the security files for PAM stored?

A

/etc/security

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

where are the configuration files stored for PAM?

A

/etc/pam.d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

What is contained on each line of a PAM application config file?

A

module_type (auth, account, session or password)

control_flag (requisite, sufficient, optional)

module_path (usually /lib/security)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

what are the module_type values for PAM?

A

auth: prompt for a password
account: determine access based on day, location, console, etc
session: what actions to perform before or after login
password: what module allows users to change passwords

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

what are the control_flag values for PAM?

A

required: the module must succeed to procede further
requisite: if this fails, nothing else is tried. immediate failure returned
sufficient: if this succeeds, return success if no other requireds
optional: continue checking other modules even if one has failed

55
Q

how do you check the swap space?

A

swapon -s

will show:

[root@bacall ~]# swapon -s
Filename Type Size Used Priority
/dev/dm-1 partition 16744440 69620 -1

56
Q

how do you prevent login for everyone but root?

A

the /etc/nologin file is present

57
Q

The PAM configuration files are corrupt and no one can log in. How do you fix it?

A

reboot in single user mode

in /etc/pam.d/login put the following:

auth required pam_unix.so

account required pam_unix.so

password required pam_unix.so

session required pam_unix.so

Causes PAM to use the /etc/passwd file

58
Q

where does PAM record errors?

A

/var/log/messages

59
Q

what determines where a machine verifies user authorization?

A

/etc/nsswitch.conf

passwd: files nis
shadow: files
group: files nis
etc. etc. etc.

60
Q

what commands verify that the local machine is using NIS correctly?

A

rpcinfo -u localhost ypbind
ypcat passwd

61
Q

what file sets the hostname of the machine?

A

/etc/sysconfig/network

HOSTNAME=<myname>.ox.com</myname>

and

/etc/hosts

129.77.226.77 viper.ox.com viper

62
Q

where are most RPM package documents stored?

A

/usr/share/doc

63
Q

what command will search the man pages for a particular topic?

A

man -f {yourSearchString}

64
Q

when listing contents of the /dev directory, what indicates a block device?

A

the letter b in the ls -la listing

brw-rw—- 1 root cdrom 11, 0 Jul 2 08:24 sr0

65
Q

what command is used to create a named pipe?

A

mknod

66
Q

how do you change the user ownership as well as the group ownership in one command?

A

chown username.groupname file

use -R to do it recursively through the directories

67
Q

how is chmod 700 different from chmod u+r u+w u+x ?

A

using binary notation 700 will replace all permissions.

using symbolic notation will only modify the permission specified

68
Q

what permissions would allow a directory to be visable, but not the files?

A

chmod 711 <dirname></dirname>

owner can change anything

group members and world cannot see the files unless they already now the file name

69
Q

what is the basic syntax for the ln command?

A

ln -s <filename> <newlinkname></newlinkname></filename>

70
Q

What GID is reservied for nobody by the different flavors of LINUX?

A

RHEL and fedora 99

UBUNTO and SUSE 65534

71
Q

what is the GECOS?

A

The long descriptive field in the /etc/passwd file normally used to keep the user’s long descriptive name.

72
Q

where do you add commands you want to run after the server is completely booted up?

A

/etc/rc.d/rc.local

73
Q

how do you re-size the swap partition?

A
Disable swap
 # swapoff -a
resize it
 # lvresize -L +1G /dev/vg0/swap
next, (re)setup swap memory :
 # mkswap /dev/vg0/swap
Now, You can re-enable swap like this:
 # swapon -a
74
Q

what command will show the detailed information about a file system including all the superblock info?

A

dumpe2fs

as in

dumpe2fs /dev/sda1

75
Q

what command will show the inodes of a file?

A

ls -lai filename

76
Q

what command will show detailed information about all the mounts?

A

cat /dev/mounts

77
Q

what command will show detailed information about the ethernet adapter settings?

A

for file in ls /proc/sys/net/ipv4; do echo $file:cat /proc/sys/net/ipv4/$file; done

78
Q

what command will show all the detail about the CPU?

A

cat /proc/cpuinfo

79
Q

what command will show the enhanced security settings for the kernel?

A

getsebool -a

to set a value use:

setsebool -P <label> <value></value></label>

-P make permanent for next reboot

80
Q

what command will do a complete backup of a disk?

A

dd if=/dev/sda2 of=/disk2/backup-sda2.img

81
Q

what tool can be used to test and diagnose problems with CameronFIX connections?

A

FIX Tester by Jettek (jettekfix.com)

Multiple simultaneous sessions supported.
Build any FIX message from a template or copy and paste.
Script messages and scenarios.

Reduce errors introduced in new production releases.

Recreate problem scenarios in development and QA environments.

82
Q

what file configures the CameronFIX system

A

config.xml

83
Q

what daemon does the CameronFIX interact with?

A

LMA or Local Management Agent daemon

84
Q

where is the cameronFIX username and password set?

A

config.xml

<session><br></br> <persister><br></br> <replicatedfilepersister></replicatedfilepersister><br></br> </persister><br></br> <messagefactory><br></br> <usernameandpasswordmessagefactory></usernameandpasswordmessagefactory><br></br> </messagefactory><br></br> </session>

85
Q

what nimsoft module monitors apps?

A

CA Nimsoft Monitor for Application Response Time

Monitor application response times to help determine if a problem affects your entire user community or only a subset.

Create and playback simulated end user behavior for each of your critical applications.

Automatically receive screenshots for any failed playback to provide which component of the application was unavailable

Alert and/or trend on:
Overall application response time
Transactions or steps that make up a response time test

Analyze and visualize the collected response time metrics

86
Q

useful monitoring apps

A

top

vmstat - virt mem stats

htop - proc viewer

netstat - net connections routing int stats

tcpdump - show eth int stats

wireshark - network snooping

lsof - view open files

iotop -monitor disk io

iostat - storage io stats

87
Q

things to check for a system not performing well

A

top

swap: should be 0

%sy lower than cpu core

%us user space

%wa: waiting for IO
adjust BIOS for disk write cache

free -m : cache used can add more to free mem

r key to re-nice priority on user PID
-20 thru 19 lower is higher priority

88
Q

what is the boot process?

A

System BIOS checks system. Launches first stage boot loader on MBR

  • 1st stage boot* loader loads GRUB into memory launches
  • 2nd stage boot* loader from the /boot/ partition.

2nd stage boot loader loads kernel into memory, which in turn loads any necessary modules and mounts root partition read-only.

The kernel transfers control of boot process to init

The init program loads all services and user-space tools, mounts all partitions listed in /etc/fstab.

The user is presented with a login screen for the freshly booted Linux system.

89
Q

what tools can be used to check the status of the ehternet connection?

A

ethtool eth0

ethtool -S eth0
(detailed display of errors or dropped packets)

mii-tool -v eth0

ifconfig -a

netstat -i

traceroute

Frame errros: defective ethernet device

Carrier Errors: Errors are caused by the NIC card losing its link connection to the hub or switch.

(check duplex)

90
Q

how do you use arp?

A

arp -d hostname
remove entry from tables

arp -n or cat /proc/net/arp
list arp table entries

91
Q

what port does ssh use?

A

22

use telnet <hostname> 22 to test connectivity on port 22</hostname>

92
Q

what is the netstat command parameters for listing communication entries?

A

netstat -na

93
Q

what file is used to tune kernel parameters and performance at runtime?

A

/etc/sysctl.conf

also use sysctl command to make command line changes to devices and kernel

sysctl -A will show all

values also found in /proc/sys/* and /proc/net/*

94
Q

what are some generic sources for loss of network connectivity and performance?

A

NIC duplex and speed incompatibilities
Network congestion
Poor routing
Bad cabling
Electrical interference
An overloaded server at the remote end of the connection
Misconfigured DNS

95
Q

what is a method of killing a daemon if you don’t know the PID and you don’t know if it is running?

A

kill cat /var/run/named/named.pid

96
Q

what are the numbers for the sections in the man pages?

A
  • 1 User tools
  • 2 System calls
  • 3 C library calls
  • 4 Device driver information
  • 5 Configuration files
  • 6 Games
  • 7 Packages
  • 8 System tools
97
Q

what command will show all the superblock information about a file?

A

stat <filename></filename>

98
Q

what command will show all the hard links related to a file?

A

get the inode number with “ls -li <filename>"</filename>

find it

find / -inum <inodenum> -print</inodenum>

99
Q

what are the numbers displayed by ls -la on a block file?

A

Major and Minor numbers

Major number: the device category

Minor Number: minor number shows the instance.

ls -l /dev/sda

brw-r—– 1 root disk 8, 0 2090-09-30 08:18 /dev/sda

Note the b at the beginning of the file’s permissions

8 is the major number,

0 is the minor number.

100
Q

what does the “p” symbolize in a file item in a list of a directory?

A

A named pipe

created by mknod command

101
Q

what command will list files in a single column display?

A

ls -1 *

102
Q

what command will list files recursively through all subdirectories?

A

ls -R

103
Q

what is an alternative to the -exec parameter for the find command?

A

pipe it into xargs as in:

find / -type f -name core | xargs rm

104
Q

what are the possible states of a process and their symbols?

A

S - Sleeping

R - running (using cpu)

D - uninteruptible sleep (io related)

T - debugger trace or has been stopped

Z - zombie
This means either
(1) the parent process has not acknowledged the death of its child using the wait system call; or
(2) the parent was improperly killed, and until the parent is completely killed, the init process cannot kill the child itself. A zombied process usually indicates poorly written software.

< - high priority process

N - low priority task

L - pages in memory are locked

105
Q

when you use ‘kill <pid>' what is being done?</pid>

A

kill sends a signal 15 REQUESTING a termination to the process.

kill -9 sends a terse kill command to the OS to completely and abruptly stop the process

106
Q

what command will display the release version number of linux?

A

lsb_release -a

107
Q

what does

sudo su - root

do?

A

sodu - check the sudoers file for permission

su - change to another user id

  • run the specified user’s login script

root - become the user

108
Q

what command will set the runlevels for a daemon?

A

in the /etc/init.d script for the daemon use;

chkconfig 35 99 01

‘35’ means chkconfig should create start and stop scripts for this daemon in runlevels 3 and 5 in
/etc/rc.d/rc3.d and /etc/rc.d/rc5.d

‘99’ means set the startup priority to 99
and ‘01’ set the stop priority to 01

109
Q

how do you add a new init script to the startup?

A

create the script file and use the command:

chkconfig –add <mynewscript></mynewscript>

This will create all the symbolic links for you and place them in the correct directories under
/etc/init.d

110
Q

what file determines the actions taken for checking the file system during boot up?

A

/.autofsck

the same actions are specified in the /etc/fstab

111
Q

what steps can be taken to boot into single user mode from the grub menu?

A

edit the grub menu.lst and add the parameter “single” at the end of the kernel command line

112
Q

What command is used to change the run level and what are the standard run levels?

A

init { 0 1 2 3 4 5 6 }

0 — Halt

1 — Single-user text mode

2 — Multiuser but no NFS

3 — Full multi-user text mode

4 — Not used (user-definable)

5 — Full multi-user with X11

6 — Reboot

113
Q

what are the fields in the /etc/inittab file?

A

id:runlevels:action:process

as in

id:3:initdefault:

only used by the older init process

newer upstart model uses files in /etc/init

114
Q

what determines your permissions to modify the cron jobs?

A

if the file exists and your user id is in /etc/cron.allow you are allowed to edit it

if the file exists and you are not present in the file, you are not allowed to edit crontab

if the file exists and your user id is not in /etc/cron.deny you are allowed to use it

if the file exists and your user id is present, you are not allowed to edit the crontab

115
Q

what is the format of the lines in the crontab?

A

minute hour day month day_of_week command

for example:

0 0, 4, 8, 12, 16, 20 * * * /bin/ping -c 5 serverB

means run /bin/ping every four hours (0, 4, 8, 12, 16, 20)

116
Q

what is the new system logging daemon and what are it’s major features?

A

rsyslog

It can act as a drop-in replacement for the more common and traditional sysklog daemon.

Some of the advanced features of rsyslogd include writing logs directly to a configured database (such as an SQL database server on another central machine) and allowing other extensive manipulation of log messages.

117
Q

what config files determine the behavior of the ethernet interfaces?

A

ifcfg-eth<#>

located in

/etc/sysconfig/network-scripts

118
Q

what is a command to listen for DHCP requests?

A

tcpdump -vnes0 -i eth0 port 67 or port 68

  • v shows more information about the packet. You can use -vv or -vvv for even more.
  • n disables name resolution so your not waiting on DNS responses to show the packet.
  • e shows link layer information (MAC Address)
  • s sets how much of the packet to see. 0 shows full packet
  • i sets the interface to use
119
Q

What is the dialog in a DHCP setup by a workstation and the DHCP server?

A

The 4 packets to a successful DHCP

DISCOVER: Client connects to the network and sends out a broadcast discovery looking for its DHCP information.

OFFER: The server offers the DHCP information to the client

REQUEST: The client requests verification of the DHCP information

ACK: The server acknowledges the DHCP request

120
Q

what command will look up the host name given an ip?

A

dig +short -x {hostname}.{domain}.com

121
Q

what command will look up the ip given the host name?

A

dig +short {hostname}.{domain}.com

122
Q

what steps can you take to troubleshoot an SQL problem?

A

1) Can you connect?
SELECT * FROM sys.Databases

2) Who is active?
EXEC master.dbo.sp_whoisactive

3) What is in the SQL Error log?
EXEC xp_readerrorlog @1=1
@p2=1

4) Quick Assesment
access?
not available?
performance?

5) Check Windows Event Log
6) Run sp_whoisactive in loop to capture activity
7) run sys.dm_os_wait_stats to see waits since last restart
8) check performance counters

9) check main performance hardware
CPU, memory, network, disk

10) Identify recent changes
query, schema, index infra

123
Q

what process can be used to analyze a java app problem?

A

Check stdout logs for the JVM
Look for stack trace pauses
Overall performance – top
Pstree –l -p -G
Jps –v then jstack <pid> to get thread states<br></br> Connection leaks to DB (exceeding limits?)<br></br> Look for SQL hang-ups<br></br> Check for hung threads ps –auxww<br></br> Check for messaging problems with corba or jms<br></br> Kill -3 <pid> for thread (-3 sigquit)</pid></pid>

124
Q

what command will tell you the linux installation processor class?

A

getconf LONG_BIT

will echo either

64

or

32

125
Q

what ls command will list files in human readable format?

A

ls -lh

126
Q

what ls command will list files and subdirectories?

A

ls -R

127
Q

what command will list files starting with the oldest first?

A

ls -ltr

128
Q

what command will list files along with a symbol for their file type?

A

ls -F

129
Q

what command will list all the details of the current user sessions running on a machine?

A

w

130
Q

what command will show the ID numbers for the user currently logged in?

A

id

131
Q

reports the history of successful user login attempts and system reboots and what file does it read?

A

the last command reads the /var/log/wtmp file. This file keeps a record of all login and logout activities including

login time

duration a user stayed logged in

tty where the user session took place.

132
Q

what command shows the reboot history of a machine?

A

last reboot

133
Q

what command lists more detailed information on recent logins and reboots and what file does it read?

A

utmpdump and is executed the following way:

utmpdump /var/log/wtmp

134
Q

What command lists all unsuccessful login attempts, what detail does it show and what file does it read?

A

The lastb command reports the history of unsuccessful user login attempts by reading the /var/log/btmp file. This file keeps a record of all unsuccessful login attempt activities including

login name

time

the tty where the attempt was made.