Foss Lab Manual Final
Foss Lab Manual Final
(AUTONOMOUS)
REGULATIONS : 2018
Aim:
Procedure:
Step 1 – Insert the Red Hat Linux DVD into the DVD-drive of your computer. As soon as the
following screen pops up, press ‘Enter’ to install Red Hat Enterprise Linux (RHEL) through GUI
mode.
Step 2- RHEL installer would then prompt you conduct a check as to whether the CD media from
which you’re installing is functioning correctly or not. Choose ‘Skip’, press enter and the installation
would begin.
Step 3- Next, we need to select the language- English or any other language as per your
preference, and then press ‘Next’ .
Step 4- In this step, the RHEL installer would ask you about the appropriate type of keyboard for the
system. We take the ‘US English’ keyboard, you can pick any other option depending on the type of
your keyboard. Then press ‘Next’ to move to the next step.
Step 5- Next, the installer would ask for an ‘installation number’ if you wish to install full set of Red
Hat functionalities. Enter the installation number and press ‘OK’ if you have an officially licensed
installation number(for corporate clients that buy Red Hat’s backup support and full features).
Others can select ‘Skip entering installation number’ and press ‘OK’ to proceed. RHEL would show a
warning message, press ‘Skip’ in it to continue.
Step 6- The Red Hat installer would then require you to create partitions in your computer’s hard
disk for the installation. You can do it in four ways but the simplest way is to select ‘Use free space
on selected drives and create default layout’ as this option will not affect any other OS residing in
your system.
Check the ‘review and modify portioning layout’ to create partitions and click next.
Step 7- In this step you must create the required system partitions and mount points such as ‘/boot’,
‘/home’, ‘swap’ etc which are required for the Linux’s proper functioning.
To create different partitions such as /home, /var etc, click on ‘New’ to create the partitions.
Then, select /home in the mount point and choose ‘ext3’ as the file system and give the desired size
for it and then click ‘OK’. Similarly also create /boot and /var.
Also, create a swap partition by clicking on ‘New’ and then choosing the filesystem as ‘swap’ and
also give the size of Swap partition.(Usually size of swap partition SHOULD BE twice the size of
RAM available to the system but you can keep its size less than that too)
Once you have made all the desired partitions and given their mount points, click ‘Next’ to continue
installation.
Step 8- This step pertains to the default OS that will be loaded by the GRUB loader
(Note- If you have multiple Operating Systems installed, you would see multiple options here and
you have to check in front of the OS name that you want to be loaded by default when the system is
started.)
Step 9- This step pertains to the network settings of the Linux system that you are going to install.
You can select the Ethernet devices through which the system would communicate with other
devices in the network.
You can also provide the hostname, Gateway address and DNS address to the system during this
step. (However it’s better to adjust these settings once the system has been fully installed).
Step 10- The next step is to adjust the system clock to your particular time zone. Select your time
zone and then click ‘Next’.
Step 11 – This is a very important step that deals with the root(super-user) password for the
system . Type the password and confirm it and then click next.
Step 12 – The RHEL installer would then prompt you about if you wish to install some extra
‘Software Development’ or ‘Web Server’ features. By default, keep it at ‘Customize later’ and press
‘Next’.
Step 13- This next step will initiate the installation of Red Hat Linux, press ‘Next’ to begin the
process.
Step 14- Upon the completion of installation you should the following screen. Press Reboot and
you’d be ready to use your newly installed Red Hat Linux OS.
POST INSTALLATION CONFIGURATIONS
2. The next step is regarding the configuration of the Firewall. You can Enable or Disable the firewall
according to your preferences and then click ‘Forward’.
3. Next step is about the configuration of another security tool- SE Linux. By default you should keep
it ‘Disabled’ unless you’re working with very secure information.
4. You can also choose to configure the Kdump, that stores information about system crashes if your
system fails but uses valuable disk space. By default don’t enable it.
5. Next, adjust the time and date settings, and then click ‘Forward’.
6. The next step is for software updates from Red Hat, at this point you should skip the registration
and register at a later time and then click ‘Forward’.
7. This step is to create a non-admin user for the system. Enter the details and click ‘Forward’.
8. This step is about configuration of your Sound Card, choose a sound device and then click
‘Forward’.
9. Click ‘Forward’ to complete the configurations and start using your Red Hat Linux OS.
(Note- On clicking ‘Finish’ the system would require a reboot if you have made changes to the
configurations of Firewall or SE Linux.)
Your Red Hat Linux OS is now all installed and configured, ready to be used. Good luck using
and exploring various features of Red Hat Linux.
Result:
Thus the above linux installation was done successfully and the
A im
Command : Cat
Purpose : It is used to display the contents of the file as well as used to create a new
file.
Command : More
Purpose : It is used to display the contents of the file on the screen at a time.
Command : Wc
Purpose : It is used to count the number of lines ,words and characters in a file or group
of files.
Example : $ wc –l devi
Command : File
Command : Spell
Purpose : It is used to split the given file into smaller pieces of given size.
Syntax : split –size <file name > < splitted file name >
Command : Cp
Command : Mv
Purpose : It is used to move a file within a directory with different names and also
Command : Rm
Example : $ rm devi
Command : Banner
Command : Who
Purpose : It is used to get the information about all the users currently working in the
system.
Syntax : who
Example : $ who
Command : Who am i
Purpose : It is used to know in which terminal the user is currently logged on.
Syntax : who am i
Example : $ who am I
Command : Date
Syntax : date
Example : $ date
Command : Cal
Purpose : It prints the calender for the specified year and month.
Command : Id
Syntax : id
Example : $ id
Command : Clear
Syntax : clear
Example : $ clear
Command : Tput
Command : Uname
Purpose : It is used to display the details about the OS in which we are working.
Syntax : uname [options]
Example : $ uname –n
Command : Tty
Syntax : tty
Example : $ tty
Command : Pwd
Syntax : pwd
Example : $ pwd
Command : Bc
Syntax : bc <operation>
Example : $ bc 3+5 8 ^d
Command : Ls
Example : $ ls –p
Command : Echo
Command : Man
Command : Head
Command : Tail
Command : Pr
Purpose : It is used to display the contents of the file by separating them into pages and
Example : $ pr devi
Command : Cut
Purpose : It is used to extract selected fields or columns from each line of one or more
Command : Paste
Purpose : It concatenates the line from each input file column by column with tab
Example : $ paste f1 f2
Command : Join
Purpose : It is used to extracts common lines from two sorted files and there should be the
Command : Uniq
Purpose : It compares adjacent lines in the file and displays the output by
Command : Sort
Purpose : It sorts one or more files based on ASCII sequence and also to merge the file.
Command : Nl
Example : $ nl devi
Command : Tr
Purpose : It is used to translate or delete a character or a string from the standard input
Command : Tee
Purpose : It is used to read the contents from standard input or from output of another
command and reproduces the output to boyh in standard output and direct
Command : grep
Purpose : It is used to search the specified pattern from one or more files.
Command : mkdir
Command : rmdir
Command : cd
Purpose : It is used to change the control from one working directory to another
specified directory.
Example : $ cd riya
Command : cd ..
Purpose : It is used to quit from current directory and move to the previous
directory.
Syntax : cd ..
Example : $ cd ..
Process Commands
Command : echo $$
Syntax : echo $$
Example : $ echo $$
Command : ps
Syntax : ps
Example : $ ps
Command :&
Command : nohup
Purpose : It permits the execution of the process even after the user has logged out.
Command : kill
Command : kill $!
Purpose : $! is the system variable which stores the process id of the last background job.
Syntax : kill $!
Example : $ kill $!
Command : at
Result:
Thus the above basic shell commands are studied and the output was verified.
Ex.No : 3
AIM:
PROCEDURE:
While users can be either people (meaning accounts tied to physical users) or accounts which exist for
specific applications to use, groups are logical expressions of organization, tying users together for a
common purpose. Users within a group can read, write, or execute files owned by that group.
Each user is associated with a unique numerical identification number called a user ID (UID). Likewise,
each group is associated with a group ID (GID). A user who creates a file is also the owner and group
owner of that file. The file is assigned separate read, write, and execute permissions for the owner, the
group, and everyone else. The file owner can be changed only by root, and access permissions can be
changed by both the root user and file owner.
Additionally, Red Hat Enterprise Linux supports access control lists (ACLs) for files and directories which
allow permissions for specific users outside of the owner to be set. For more information about this feature,
refer to the Access Control Lists chapter of the Storage Administration Guide.
Red Hat Enterprise Linux uses a user private group (UPG) scheme, which makes UNIX groups easier to
manage. A user private group is created whenever a new user is added to the system. It has the same
name as the user for which it was created and that user is the only member of the user private group.
User private groups make it safe to set default permissions for a newly created file or directory, allowing
both the user and the group of that user to make modifications to the file or directory.
The setting which determines what permissions are applied to a newly created file or directory is called a
umask and is configured in the /etc/bashrc file. Traditionally on UNIX systems, the umask is set to 022,
which allows only the user who created the file or directory to make modifications. Under this scheme, all
other users, including members of the creator's group, are not allowed to make any modifications. However,
under the UPG scheme, this “group protection” is not necessary since every user has their own private
group.
3.1.2. Shadow Passwords
In environments with multiple users, it is very important to use shadow passwords provided by the shadow-
utils package to enhance the security of system authentication files. For this reason, the installation program
enables shadow passwords by default.
The following is a list of the advantages shadow passwords have over the traditional way of storing
passwords on UNIX-based systems:
Shadow passwords improve system security by moving encrypted password hashes from the world-
readable /etc/passwd file to /etc/shadow, which is readable only by the root user.
Shadow passwords store information about password aging.
Shadow passwords allow the /etc/login.defs file to enforce security policies.
Most utilities provided by the shadow-utils package work properly whether or not shadow passwords are
enabled. However, since password aging information is stored exclusively in the /etc/shadow file, any
commands which create or modify password aging information do not work. The following is a list of utilities
and commands that do not work without first enabling shadow passwords:
The User Manager application allows you to view, modify, add, and delete local users and groups
in the graphical user interface. To start the application, either select System → Administration →
Users and Groups from the panel, or type system-config-users at a shell prompt. Note that unless
you have superuser privileges, the application will prompt you to authenticate as root.
The main window of the User Manager is divided into two tabs: The Users tab provides a list of
local users along with additional information about their user ID, primary group, home directory,
login shell, and full name. The Groups tab provides a list of local groups with information about
their group ID and group members.
To add a new user, click the Add User button. A window as shown in Figure 3.2, “Adding a new
user” appears.
The Add New User dialog box allows you to provide information about the newly created user. In
order to create a user, enter the username and full name in the appropriate fields and then type the
user's password in the Password and Confirm Password fields. The password must be at least
six characters long.
Password security advice
It is advisable to use a much longer password, as this makes it more difficult for an intruder to guess
it and access the account without permission. It is also recommended that the password not be
based on a dictionary term: use a combination of letters, numbers and special characters.
The Login Shell pulldown list allows you to select a login shell for the user. If you are not sure
which shell to select, accept the default value of /bin/bash.
By default, the User Manager application creates the home directory for a new user in
/home/username/. You can choose not to create the home directory by clearing the Create home
directory checkbox, or change this directory by editing the content of the Home Directory text box.
Note that when the home directory is created, default configuration files are copied into it from the
/etc/skel/ directory.
Red Hat Enterprise Linux uses a user private group (UPG) scheme. Whenever you create a new
user, a unique group with the same name as the user is created by default. If you do not want to
create this group, clear the Create a private group for the user checkbox.
To specify a user ID for the user, select Specify user ID manually. If the option is not selected, the
next available user ID above 500 is assigned to the new user. Because Red Hat Enterprise Linux
reserves user IDs below 500 for system users, it is not advisable to manually assign user IDs 1–
499.
Clicking the OK button creates the new user. To configure more advanced user properties, such as
password expiration, modify the user's properties after adding the user.
To add a new user group, select Add Group from the toolbar. A window similar to Figure 3.3, “New Group”
appears. Type the name of the new group. To specify a group ID for the new group, select Specify group
ID manually and select the GID. Note that Red Hat Enterprise Linux also reserves group IDs lower than
500 for system groups.
Figure 3.3. New Group
Click OK to create the group. The new group appears in the group list.
To view the properties of an existing user, click on the Users tab, select the user from the user list, and click
Properties from the menu (or choose File → Properties from the pulldown menu). A window similar to
Figure 3.4, “User Properties” appears.
Figure 3.4. User Properties
User Data — Shows the basic user information configured when you added the user. Use this tab
to change the user's full name, password, home directory, or login shell.
Account Info — Select Enable account expiration if you want the account to expire on a certain
date. Enter the date in the provided fields. Select Local password is locked to lock the user
account and prevent the user from logging into the system.
Password Info — Displays the date that the user's password last changed. To force the user to
change passwords after a certain number of days, select Enable password expiration and enter a
desired value in the Days before change required: field. The number of days before the user's
password expires, the number of days before the user is warned to change passwords, and days
before the account becomes inactive can also be changed.
Groups — Allows you to view and configure the Primary Group of the user, as well as other groups
that you want the user to be a member of.
To view the properties of an existing group, select the group from the group list and click Properties
from the menu (or choose File → Properties from the pulldown menu). A window similar to
Figure 3.5, “Group Properties” appears.
Figure 3.5. Group Properties
The Group Users tab displays which users are members of the group. Use this tab to add or
remove users from the group. Click OK to save your changes.
The easiest way to manage users and groups on Red Hat Enterprise Linux is to use the User Manager
application as described in Section 3.2, “Using the User Manager Tool”. However, if you prefer command
line tools or do not have the X Window System installed, you can use command line utilities that are listed in
Table 3.1, “Command line utilities for managing users and groups”.
Utilities Description
useradd, usermod,
Standard utilities for adding, modifying, and deleting user accounts.
userdel
groupadd, groupmod,
Standard utilities for adding, modifying, and deleting groups.
groupdel
Utilities that can be used for verification of the password, group, and associated
pwck, grpck
shadow files.
Utilities that can be used for the conversion of passwords to shadow passwords, or
pwconv, pwunconv
back from shadow passwords to standard passwords.
3.3.1. Adding a New User
To add a new user to the system, typing the following at a shell prompt as root:
By default, the useradd command creates a locked user account. To unlock the account, run the following
command as root to assign a password:
passwd username
Optionally, you can set password aging policy. Refer to Red Hat Enterprise Linux 6 Security Guide for
information on how to enable password aging.
Option Description
comment can be replaced with any string. This option is generally used to specify the full
-c 'comment'
name of a user.
-d home_director
Home directory to be used instead of default /home/username/.
y
Number of days after the password expires until the account is disabled. If 0 is specified,
-f days the account is disabled immediately after the password expires. If -1 is specified, the
account is not be disabled after the password expires.
Group name or group number for the user's default group. The group must exist prior to
-g group_name
being specified here.
List of additional (other than default) group names or group numbers, separated by
-G group_list commas, of which the user is a member. The groups must exist prior to being specified
here.
-r Create a system account with a UID less than 500 and without a home directory.
-u uid User ID for the user, which must be unique and greater than 499.
To add a new group to the system, type the following at a shell prompt as root:
groupadd [options] group_name
…where options are command line options as described in Table 3.3, “groupadd command line options”.
Option Description
When used with -g gid and gid already exists, groupadd will choose another unique
-f, --force
gid for the group.
-g gid Group ID for the group, which must be unique and greater than 499.
-K, --key key=value Override /etc/login.defs defaults.
-o, --non-unique Allow to create groups with duplicate.
-p,
Use this encrypted password for the new group.
--password password
-r Create a system group with a GID less than 500.
System administrators usually like to create a group for each major project and assign people to the group
when they need to access that project's files. With this traditional scheme, file managing is difficult; when
someone creates a file, it is associated with the primary group to which they belong. When a single person
works on multiple projects, it becomes difficult to associate the right files with the right group. However, with
the UPG scheme, groups are automatically assigned to files created within a directory with the setgid bit set.
The setgid bit makes managing group projects that share a common directory very simple because any files
a user creates within the directory are owned by the group which owns the directory.
For example, a group of people need to work on files in the /opt/myproject/ directory. Some people are
trusted to modify the contents of this directory, but not everyone.
1. As root, create the /opt/myproject/ directory by typing the following at a shell prompt:
mkdir /opt/myproject
groupadd myproject
3. Associate the contents of the /opt/myproject/ directory with the myproject group:
Permission types:
User types:
User – the user name of the owner of the file or directory; if a user creates a file or directory it
becomes the owner of that file of directory.
Group – a group of users (ftp, mysql), all group members have the same rights for the file or
directory.
Other – all users that do not own the file or directory and they do not belong to any group that has
right for the file or directory
Setting permissions:
You can set the permissions using the chmod command. There two methods for changing file permissions:
Symbolic mode
Numeric mode
Symbolic mode
Actions are defined using mathematical symbols: the + (plus) symbol is used to add a permission, the -
(minus) symbol is used to remove a permission, and the = (equal) symbol is used to remove the old
permission and set a new one.
For the owners, associated symbols are u for user, g for group, o for others (the rest) and a for all.
Numeric mode
Instead of symbols, the associated number are used for setting permissions. The number for each owner
will be the sum of the permissions for that owner.
To set the reading, writing and execution rights for the user you use the number 7 (4+2+1); to set the
reading and writing rights for group will you use the number 6 (4+2); the reading permission for the rest
(others) will be set using number 4.
0 | ---
11 | --x
22 | -w-
33 |
4-wx
54 | r--
65 | r-x
76 | rw-
87 |
rwx
Thus the above experiment was done successfully and the result was verified.
Aim:
To Configuring the networking, basics of TCP/IP networking and routing , connection to the internet
(through dialup, DSL, Ethernet, leased line) in linux.
Procedure:
The NetworkManager daemon runs with root privileges and is usually configured to start up at boot time.
You can determine whether the NetworkManager daemon is running by entering this command as root:
~]# service NetworkManager status
NetworkManager (pid 1527) is running...
The service command will report NetworkManager is stopped if the NetworkManager service is not
running. To start it for the current session:
~]# service NetworkManager start
Run the chkconfig command to ensure that NetworkManager starts up every time the system boots:
~]# chkconfig NetworkManager on
Users do not interact with the NetworkManager system service directly. Instead, you can perform network
configuration tasks via NetworkManager's Notification Area applet. The applet has multiple states that
serve as visual indicators for the type of connection you are currently using. Hover the pointer over the
applet icon for tooltip information on the current connection state.
If you do not see the NetworkManager applet in the GNOME panel, and assuming that the
NetworkManager package is installed on your system, you can start the applet by running the following
command as a normal user (not root):
~]$ nm-applet &
After running this command, the applet appears in your Notification Area. You can ensure that the applet
runs each time you log in by clicking System → Preferences → Startup Applications to open the Startup
Applications Preferences window. Then, select the Startup Programs tab and check the box next to
NetworkManager.
2.1. Connecting to a Network
When you left-click on the applet icon, you are presented with:
a list of categorized networks you are currently connected to (such as Wired and Wireless);
a list of all Available Networks that NetworkManager has detected;
options for connecting to any configured Virtual Private Networks (VPNs); and,
options for connecting to hidden or new wireless networks.
If you are connected to a network, its name is presented in bold typeface under its network type, such as
Wired or Wireless. When many networks are available, such as wireless access points, the More
networks expandable menu entry appears.
2.2. Configuring New and Editing Existing Connections
Next, right-click on the NetworkManager applet to open its context menu, which is the main point of entry
for interacting with NetworkManager to configure connections.
Ensure that the Enable Networking box is checked. If the system has detected a wireless card, then you
will also see an Enable Wireless menu option. Check the Enable Wireless checkbox as well.
NetworkManager notifies you of network connection status changes if you check the Enable Notifications
box. Clicking the Connection Information entry presents an informative Connection Information window
that lists the connection type and interface, your IP address and routing details, and so on.
Finally, clicking on Edit Connections opens the Network Connections window, from where you can
perform most of your network configuration tasks. Note that this window can also be opened by running, as
a normal user:
~]$ nm-connection-editor &
For any connection type you add or configure, you can choose whether you want NetworkManager to try to
connect to that network automatically when it is available.
1. Right-click on the NetworkManager applet icon in the Notification Area and click Edit
Connections. The Network Connections window appears.
2. Click the arrow head if necessary to reveal the list of connections.
3. Select the specific connection that you want to configure and click Edit.
4. Check Connect automatically to cause NetworkManager to auto-connect to the connection
whenever NetworkManager detects that it is available. Uncheck the checkbox if you do not want
NetworkManager to connect automatically. If the box is unchecked, you will have to select that
connection manually in the NetworkManager applet's left-click menu to cause it to connect.
NetworkManager connections are always either user connections or system connections. Depending on
the system-specific policy that the administrator has configured, users may need root privileges to create
and modify system connections. NetworkManager's default policy enables users to create and modify user
connections, but requires them to have root privileges to add, modify or delete system connections.
User connections are so-called because they are specific to the user who creates them. In contrast to
system connections, whose configurations are stored under the /etc/sysconfig/network-scripts/ directory
(mainly in ifcfg-<network_type> interface configuration files), user connection settings are stored in the
GConf configuration database and the GNOME keyring, and are only available during login sessions for the
user who created them. Thus, logging out of the desktop session causes user-specific connections to
become unavailable.
Because NetworkManager uses the GConf and GNOME keyring applications to store user connection
settings, and because these settings are specific to your desktop session, it is highly recommended to
configure your personal VPN connections as user connections. If you do so, other Non-root users on the
system cannot view or access these connections in any way.
System connections, on the other hand, become available at boot time and can be used by other users on
the system without first logging in to a desktop session.
NetworkManager can quickly and conveniently convert user to system connections and vice versa.
Converting a user connection to a system connection causes NetworkManager to create the relevant
interface configuration files under the /etc/sysconfig/network-scripts/ directory, and to delete the GConf
settings from the user's session. Conversely, converting a system to a user-specific connection causes
NetworkManager to remove the system-wide configuration files and create the corresponding
GConf/GNOME keyring settings.
Depending on the system's policy, you may need root privileges on the system in order to change whether a
connection is user-specific or system-wide.
1. Right-click on the NetworkManager applet icon in the Notification Area and click Edit
Connections. The Network Connections window appears.
2. If needed, select the arrow head (on the left hand side) to hide and reveal the types of available
network connections.
3. Select the specific connection that you want to configure and click Edit.
4. Check the Available to all users checkbox to ask NetworkManager to make the connection a
system-wide connection. Depending on system policy, you may then be prompted for the root
password by the PolicyKit application. If so, enter the root password to finalize the change.
Conversely, uncheck the Available to all users checkbox to make the connection user-specific.
3. Establishing Connections
To establish a wired network connection, Right-click on the NetworkManager applet to open its context
menu, ensure that the Enable Networking box is checked, then click on Edit Connections. This opens the
Network Connections window. Note that this window can also be opened by running, as a normal user:
~]$ nm-connection-editor &
You can click on the arrow head to reveal and hide the list of connections as needed.
Figure 8.6. The Network Connections window showing the newly created System eth0 connection
The system startup scripts create and configure a single wired connection called System eth0 by default on
all systems. Although you can edit System eth0, creating a new wired connection for your custom settings
is recommended. You can create a new wired connection by clicking the Add button, selecting the Wired
entry from the list that appears and then clicking the Create button.
Figure 8.7. Selecting a new connection type from the "Choose a Connection Type" list
When you add a new connection by clicking the Add button, a list of connection types appears. Once you
have made a selection and clicked on the Create button, NetworkManager creates a new configuration file
for that connection and then opens the same dialog that is used for editing an existing connection. There is
no difference between these dialogs. In effect, you are always editing a connection; the difference only lies
in whether that connection previously existed or was just created by NetworkManager when you clicked
Create.
This section is intended for those installations which have a DSL card fitted within a host rather than the
external combined DSL modem router combinations typical of private consumer or SOHO installations.
You can configure a new DSL connection by opening the Network Connections window, clicking the Add
button and selecting DSL from the Hardware section of the new connection list.
1. Right-click on the NetworkManager applet icon in the Notification Area and click Edit
Connections. The Network Connections window appears.
2. Click the Add button.
3. The Choose a Connection Type list appears.
4. Select DSL and press the Create button.
5. The Editing DSL Connection 1 window appears.
You can configure an existing DSL connection by opening the Network Connections window and selecting
the name of the connection from the list. Then click the Edit button.
1. Right-click on the NetworkManager applet icon in the Notification Area and click Edit
Connections. The Network Connections window appears.
2. Select the connection you wish to edit and click the Edit button.
Connection name — Enter a descriptive name for your network connection. This name will be used
to list this connection in the DSL section of the Network Connections window.
Connect automatically — Check this box if you want NetworkManager to auto-connect to this
connection when it is available. Refer to Section 8.2.3, “Connecting to a Network Automatically” for
more information.
Available to all users — Check this box to create a connection available to all users on the system.
Changing this setting may require root privileges. Refer to Section 8.2.4, “User and System
Connections” for details.
Enter the user name used to authenticate with the service provider.
Service
Password
Saving Your New (or Modified) Connection and Making Further Configurations
Once you have finished editing your DSL connection, click the Apply button and NetworkManager will
immediately save your customized configuration. Given a correct configuration, you can connect to your
new or customized connection by selecting it from the NetworkManager Notification Area applet.
Figure 8.8. Editing the newly created Wired connection System eth0
MAC Address
Network hardware such as a Network Interface Card (NIC) has a unique MAC address (Media
Access Control; also known as a hardware address) that identifies it to the system. Running the ip
addr command will show the MAC address associated with each interface. For example, in the
following ip addr output, the MAC address for the eth0 interface (which is 52:54:00:26:9e:f1)
immediately follows the link/ether keyword:
~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN
qlen 1000
link/ether 52:54:00:26:9e:f1 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.251/24 brd 192.168.122.255 scope global eth0
inet6 fe80::5054:ff:fe26:9ef1/64 scope link
valid_lft forever preferred_lft forever
A single system can have one or more NICs installed on it. The MAC address field therefore allows
you to associate a specific NIC with a specific connection (or connections). As mentioned, you can
determine the MAC address using the ip addr command, and then copy and paste that value into
the MAC address text-entry field.
The cloned MAC address field is mostly for use in such situations were a network service has been
restricted to a specific MAC address and you need to emulate that MAC address.
MTU
The MTU (Maximum Transmission Unit) value represents the size in bytes of the largest packet that
the connection will use to transmit. This value defaults to 1500 when using IPv4, or a variable
number 1280 or higher for IPv6, and does not generally need to be specified or changed.
Saving Your New (or Modified) Connection and Making Further Configurations
Once you have finished editing your wired connection, click the Apply button and NetworkManager will
immediately save your customized configuration. Given a correct configuration, you can connect to your
new or customized connection by selecting it from the NetworkManager Notification Area applet.
Result:
Thus the above experiment was done successfully and the result was verified.
Ex.No:5 PERFORMING EVERYDAY TASKS
Aim:
Procedure:
1. Launch the terminal (Ctrl + Alt +T) type the command below and strike enter:
4. After installation has been completed, run the command below to make SoX play .mp3 and other audio
file formats.
5. After the installation is done. Now you are ready to play any audio file from any directory.
6. To play all .mp3 files in any directory, change directory and use this command:
play *mp3
8. To play next track Press Ctrl + c once and to stop or quit player, Press Ctrl and hit c twice.
9. For more about Sox , type man sox in the terminal and hit enter.
c) mutt: Mutt is a small but very powerful text based program for reading electronic mail under UNIX
operating systems, including support color terminals, MIME, and a threaded sorting mode.
d) pine: Yet another text based program for reading electronic mail under UNIX operating systems.
Originally written for inexperienced users, Pine's basic features are generally very easy to use.
(i) Check for mail / print names of those who have sent mail
The from utility prints out the mail header lines from the invoker’s mailbox.
$ from
In normal usage mail is given no arguments and checks your mail out of the post office, then prints out a
one line header of each message found. The current message is initially the first message (numbered 1)
and can be printed using the print command (which can be abbreviated ‘p’). You can move among the
messages much as you move between lines in ed, with the commands ‘+’ and ‘-’ moving backwards and
forwards, and simple numbers.
Hi,
This is a test
.
Cc:
You can also type mutt or pine to read and send mail:
$ mutt
(iv) Sending Email With Attachments From Unix / Linux Command [ Shell Prompt ]
If you need to send an email with a text file (or binary file) as attachment using shell script or command
prompt in Unix or Linux; try mutt - a terminal-based e-mail client for Unix-like systems.
Mutt is a small but very powerful text based program for reading electronic mail under UNIX /Linux operating
systems, including support for color terminals, MIME, and a threaded sorting mode.
Please note that mutt is a pure MUA and cannot send e-mail without proper email server . You need a
working Mail Transfer Agent (MTA) such as sendmail or postfix. I am assuming that you have a working
email server in your office.
If mutt is not installed, use the apt-get or yum or up2date commands as follows (you must login as a root
user). Debian / Ubuntu Linux user type the following command to install mutt client:
# apt-get install mutt
Fedora / CentOS or Red Hat Enterprise Linux (RHEL) user type following command to install mutt:
# yum install mutt
OR (RHEL version <= 4 )
# up2date mutt
FreeBSD user type the following command to install mutt via pkg_add command:
# pkg_add -v -r mutt
(i)SCP Introduction
scp stands for secure cp (copy), which means you can copy files across ssh connection. That connection
will be securely encrypted, it is a very secure way to copy files between computers
You can use scp to copy files from or to a remote server. You can also copy files from one remote server to
another remote server, without passing traffic through your PC.
You can use scp on Linux, Mac and Windows (using WinSCP).
SCP Usage
scp [[user@]from-host:]source-file [[user@]to-host:][destination-file]
from-host
Is the name or IP of the host where the source file is, this can be omitted if the from-host is the host
where you are actually issuing the command
user
Is the user which have the right to access the file and directory, that is supposed to be copied in the
case of the from-host, and the user who has the rights to write in the to-host
source-file
Is the file or files that are going to be copied to the destination host, it can be a directory but in that
case you need to specify the -r option to copy the contents of the directory
destination-file
Is the name that the copied file is going to take in the to-host, if none is given all copied files are
going to keep its names
SCP Options
-p
Preserves the modification and access times, as well as the permissions of the source-file in the
destination-file
-q
-r
Recursive, so it copies the contents of the source-file (directory in this case) recursively
-v
SCP Examples
That is going to copy all files with .txt extension to the folder /home/user in the remote.server.com host
That is going to recursively copy all files from Miguel’s home directory on 10.1.2.2 to his home folder in
10.1.2.3 host.
As have been told before, scp copies files between computers using ssh, and there are three types of
usage:
This is really interesting and very useful, as the files copied from one server to the other, are not going to
pass through your computer. The traffic is going to pass from one server to the other directly.
scp uses AES-128 to encrypt data, this is very secure, but also a litle bit slow. If you need more speed and
still have security, you can use Blowfish or RC4.
To increase scp speed change chipher from the default AES-128 to Blowfish
This last one is not very secure, and it may not be used if security is really an issue for you. You can also
increase security while decreasing speed. Everything has its cost.
That is maybe the slowest, but also maybe the more secure one (I may be wrong, I’m not an expert in
encryption).
If you are unable to locate it in the menus, you may try to launch it using the command "playonlinux" from a
terminal window. If this fails it is probably not correctly installed and you should consult the download
instructions again.
When you first start PlayOnLinux, you will find that the main screen is rather empty. That is because most of
the space is reserved for the list of application that are installed, which are currently none. In order to nstall
applications, click the Install button.
The install dialog allows you to select an application either by navigating through the categories listed on the
left, or through the search bar located at the top of the dialog.
After you have located the application you want, you must first select it in the list and then click "Apply".
Once you have clicked apply, the application specific installer is launched. Unless you are installing a patch
to an existing application, most installers will begin with a presentation of the application. Following that it
will create the PlayOnLinux directory for this application's files.
After this point several things could happen - the installer may begin downloading, it may ask for a setup file,
it may ask for the CD-ROM of the game depending on what the game needs to do. This will depend
completely on the application and what is scripted for it. Some examples are included below as illustration
At some point, PlayOnLinux will launch the application's native Windows installer. Since the form is
completely up to the application, there is no example but you must navigate through this yourself. What is
important is that scripts may need to modify this installation after it has completed, so please install to the
default directory using the default options unless you have been instructed otherwise. After the installer has
finished, PlayOnLinux will present a shortcut dialog of its own. Please select the options you want.
Running an application
At this point PlayOnLinux will tell you that the installation is finished, and you will return to the main window.
The application you installed will have been added to the list. To run this application, simply select the
application from the list and click run. You can also double-click the application instead, or you can launch it
from the desktop or regular menu if you chose to install those shortcuts.
Removing an application
To remove an application, simply select it in the list and click Remove. Note that while the application and all
its files and registry settings are deleted, currently PlayOnLinux may not remove all shortcuts to the
application.
5.WRITING IN CD
To create a DVD from which to install an up-to-date copy of Ubuntu, you first need to download a copy of
the latest version. Once you’ve done so, you can create your installation DVD. The procedure may differ
slightly depending on which version of Ubuntu you are currently using.
1. Insert a blank CD into your burner. A 'CD/DVD Creator', 'Choose Disc Type' or 'Blank Disc' window
might pop up. Close this, because we will not be using it.
5. Select the write speed. If you are burning an Ubuntu Live CD (one that you may want to start your
computer up from), it is recommended that you write at the lowest possible speed.
6. Start the burning process.
7. After burning is completed, verify that your CD contains multiple files and folders and not just the
ISO file. This way you will know the process was completed correctly.
Result:
Thus the above experiment was successfully completed and the result was verified.
Aim:
To write procedure to setup web server for http services, printer services, proxy services.
Procedure:
1. Installing Apache:
Getting apache onto your Ubuntu machine is easy. Using either the Synaptic Package Manager,
Ubuntu Software Center, search and install the “apache2” module. Alternatively, you can open a
terminal and type the following command:
After you have installed Apache, it will be added to the init.d list and will auto start whenever you
boot up your computer. The following commands allow you to start, restart, stop Apache.
Note: the above commands will work in debian-based distro (including Ubuntu) only.
By default, apache will operate on the “/var/www” folder. This means that whatever files you place
in this /var/www folder will be visible from the URL http://localhost. In some instances, you may
want the “localhost” to point to another folder instead, say /home/user/public_html. Here is how
you do it:
First, make sure the /home/damien/public_html folder exists. Create a simple html file, name it
index.html and place it in the public_html folder.
Open a terminal and type:
Now, in your browser, reload the URL http://localhost. You should see the html file that you have
placed in the public_html folder.
4.Configuring different sites
The above trick allows you to change the default operating folder of apache, however, some of you
might not want to override the default settings. An alternative is to create multiple sites and point
apache to the active site.
Disable the default setting and make active the site1 settings
With this trick, you can create multiple site configuration file, each pointing to a different folder.
You can then easily switch between the sites with the a2dissite and a2ensite command
Enabling .htaccess file
.htaccess file is a powerful file that can be used to control and customize a site server behavior
without editing the core Apache module. By default, the .htaccess functionality is turned off and all
instances of .htaccess files are completely ignored. The server will not even attempt to read
.htaccess files in the filesystem.
To enable .htaccess file, open up the settings file that you have created earlier:
Scroll down the file until you see the part “<Directory /home/user/public_html/>“.
Underneath that line of code, change AllowOverride None to AllowOverride All.
Result:
Thus the above experiment was done successfully and the result was verified.
7.QT Programs
Aim:
C)Layout Management
Procedure :
mkdir dirname
chdir dirname
Gedit filename.cpp
qmake – project
qmake
make
./filename
Program:
A.Creating Window
#include <QtGui>
Output:
B.Creating a new simple notepad
#include <QtGui>
QWidget window;
window.setLayout(layout);
window.show();
return app.exec();
}
Output:
C. Layout Management
#include <QtGui>
#include "dialog.h"
Dialog::Dialog()
{
createMenu();
createHorizontalGroupBox();
createGridGroupBox();
createFormGroupBox();
setWindowTitle(tr("Basic Layouts"));
}
void Dialog::createMenu()
{
menuBar = new QMenuBar;
void Dialog::createHorizontalGroupBox()
{
horizontalGroupBox = new QGroupBox(tr("Horizontal layout"));
QHBoxLayout *layout = new QHBoxLayout;
void Dialog::createGridGroupBox()
{
gridGroupBox = new QGroupBox(tr("Grid layout"));
QGridLayout *layout = new QGridLayout;
layout->setColumnStretch(1, 10);
layout->setColumnStretch(2, 20);
gridGroupBox->setLayout(layout);
}
void Dialog::createFormGroupBox()
{
formGroupBox = new QGroupBox(tr("Form layout"));
QFormLayout *layout = new QFormLayout;
layout->addRow(new QLabel(tr("Line 1:")), new QLineEdit);
layout->addRow(new QLabel(tr("Line 2, long text:")), new QComboBox);
layout->addRow(new QLabel(tr("Line 3:")), new QSpinBox);
formGroupBox->setLayout(layout);
}
Output:
Result:
Thus the above Qt Programs are executed successfully and the result was verified.
8.GTK Programming
Aim:
Procedure:
Program:
import gtk
class PyApp(gtk.Window):
def __init__(self):
super(PyApp, self).__init__()
self.set_title("Box demo")
box = gtk.VBox()
vb = gtk.VBox()
lbl = gtk.Label("Enter name")
Thus the above programs are executed and the result was verified.
Aim:
To make data base connectivity by using PHP & Mysql.
Program:
Front End:
<html>
<head>
</head>
Name:
</br>
<br>
Rollno:
</br>
<br>
Dept:
</br>
<br>
Option:
</br>
<br>
</br>
</body>
</html>
<?php
mysql_connect("localhost","root","");
mysql_select_db("student");
$a=$_POST['name'];
$b=$_POST['rollno'];
$c=$_POST['dept'];
$d=$_POST['opt'];
?>
Result :
Thus the above program was executed and the result was verified.
10.Installing Samba
Aim:
To write simple procedure to install & Configure samba server.
Procedure :
A Samba file server enables file sharing across different operating systems over a network. It lets
you access your desktop files from a laptop and share files with Windows and macOS users.
Installing Samba
whereis samba
The following should be its output:
2.Setting Up Samba
mkdir /home/<username>/sambashare/
The command above creates a new folder sambashare in our home directory which we will share
later.
The configuration file for Samba is located at /etc/samba/smb.conf. To add the new directory as a
share, we edit the file by running:
[sambashare]
comment = Samba on Ubuntu
path = /home/username/sambashare
read only = no
browsable = yes
Then press Ctrl-O to save and Ctrl-X to exit from the nano text editor.
Now that we have our new share configured, save it and restart Samba for it to take effect:
Connecting to Share
enter:
enter:
On Windows, open up File Manager and edit the file path to:
\\ip-address\sambashare
Note: ip-address is the Samba server IP address and sambashare is the name of the share.
connect!
Result:
Thus the samba server installation was done successfully and the output was verified.