Post Install Exercises
Post Install Exercises
Post Install Exercises
if you are interested in seeing what groups your account belongs to you can type: $ sudo vigr You are now in the vi editor (you have a handout to help you with this editor). Type: /yourUserid Then press the n key for next to see each group you belong to. Notice that you are in the adm group. To exit vi type: :q! Get used to using sudo to do your system administration work. Exercise number 9, will give you a couple of other options for using system privileged commands as well.
Changing the user information for inst Enter the new value, or press ENTER for the default Full Name []: <Press ENTER Room Number []: <Press ENTER Work Phone []: <Press ENTER Home Phone []: <Press ENTER Other []: <Press ENTER Is the information correct? [y/N] y <Press ENTER
user@pcn:~# At this point you are done and the user inst now exists on your machine. In order to allow the new inst user to use the sudo command it must be a member of the adm group. To do this you can type: $ sudo usermod -G adm inst And, to verify that inst is now a member of the adm group: $ groups inst
You don't need to read each man page in detail as this could take a while, but review them enough to understand the basics of each command and how they differ. After reading try a few commands: $ dpkg $ dpkg help | more [space for next page, or CTRL-C to exit more screen]
$ $ $ $ $ $ $
apt-get | more sudo apt-get check [what does the check option do?] aptitude [Look around at what is installed.] apt-cache | more apt-cache stats apt-cache search nagios2 apt-cache showpkg nagios2 | more
Update this by simply commenting out the one line (see your vi reference sheet for help):
# # deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted # deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted
Now the apt command (apt-get) won't attempt to read your cd-rom drive each time you install software.
To make sure that all your local repository lists are up to date.
script and install it for use on your machine: $ $ $ $ cd wget http://noc/workshop/scripts/rc-config chmod 755 rc-config sudo mv rc-config /usr/local/bin
At this point the script is installed. You should be able to just run the script by typing: $ rc-config Try viewing all scripts and their status for all run-levels: $ rc-config -l Now trying viewing the status of just one script: $ rc-config -ls anacron You can see how this script works, if you understand enough of bash scripts, by taking a look at it's code: $ less /usr/local/bin/rc-config
With the ip command you can do: $ sudo ip link set eth0 promisc on Note the use of sudo here as setting an interface requires admin privileges. Now you can snoop the packets on the eth0 interface by doing: $ sudo tcpdump -i eth0 Be sure to read the man page for tcpdump if you want further information.
8.) Create the locate database One of the easiest ways to find files on your system is to use the locate command. For details, as usual, read the man pages: $ man locate We assume you are familiar with this command, but building the locate database is a bit different on different Linux and Unix versions. Locate uses a hashed database of f filenames and directory paths. the command searches the database instead of the file system to find files. While this is much is much more efficient it has two downsides: 1. If you create the locate database as root then users can see files using locate that they otherwise would not be able to see. This is considered a potential security hole. 2. The locate command is only as precise as the locate database. If the database has not been recently updated, then newer files will be missed. Many systems use an automated (cron) job to update the locate database on a daily basis. To create an initial locate database, or update the current one do: $ sudo updatedb Once this process completes (it may take a few minutes) try using the command: $ locate ssh Quite a few files go past on the screen. To find any file with ssh in it's name or it's path and which has the string conf you can do: $ locate ssh | grep conf Read about grep using man grep for more information. The locate command is very powerful and useful. For a more exacting command you can consider using find. This is harder to use and works by brute-force. As usual do man find for more information.
Reading the descriptions made it apparent that the version of PHP needed was in the libapache2-modphp5 package.
To test whether or not our Apache install has worked we can use the text-based lynx web browser. This is not installed by default, so first we must do: $ sudo apt-get install lynx Once the install completes type: $ lynx localhost and you should see the default apache2 directory listed. Press Q to quit from lynx. PHP has already been configured to load and Apache has been reconfigured to execute files with extensions of .php, but because the PHP module was installed after Apache in the command above you must reload/restart the Apache web server for the new configuration to take affect. There are multiple ways to do this, but one that is easy to remember is: $ /etc/init.d/apache2 restart Go ahead and do this now.
Your instructor will tell you whether to go ahead with the next two exercises.
$ cd $ sudo Xorg -configure This should create the file xorg.conf.new. To finalize configuring your X Server do: $ sudo cp xorg.conf.new /etc/X11/xorg.conf Now type: $ gdm and your Gnome desktop environment should start. You can log in with your username and password.