Sunteți pe pagina 1din 28

1. Installing Linux/Windows-2008 server.

Aim: Red Hat Installation in command prompt


Procedure
1. Insert the downloaded Red hat Linux DVD on the DVD ROM, make the DVD ROM to boot
first by changing the boot devices priority in the bios setup by pressing Del or F2 or F10 key
depending upon your manufacture.

2. Tab to Edit the menu, at the end type Linux text

3. DVD will check the hardware information; it will ask you to verify the integrity of the
installation media (DVD). Select Skip by using Tab and Enter to continue.
4. Use Tab and press Enter on Welcome Screen.

5. Use up or down arrow to select the language and Tab or Alt-Tab to switch between options,

Press Enter to OK.


6. Use up or down arrow to select the keyboard and Tab or Alt-Tab to switch between options,
press Enter to OK.
7. Next is the new installation for the HDD, it will ask you to initialize the HDD because
it doesnt have partition or table. If you are trying to install on the HDD that has other
partitions, wont ask you like this.

8. Select the Time Zone


9. Enter root password.

10. As this is the new installation, you can select Replace Existing Linux
System and then press enter.

11. Confirm the installation.


12. installing the Red hat Enterprise Linux

13. Installation finished, Enter to reboot.

14. Login with as root with its password.


15. Red Hat (RHEL) 6 Gnome Desktop, empty and default look.

Result:
Aim: Windows Server 2008 Installation
Procedure

Steps to install Windows Server 2008:


1. Insert the appropriate Windows Server 2008 installation media into your DVD drive.
2. Reboot the computer.

3. When prompted for an installation language and other regional options, make your
selection and press Next.

4. Next, press Install Now to begin the installation process.


5. Select your correct version in the next screen,
6. Read and accept the license terms by clicking to select the checkbox and
pressing next.

7. In the "Which type of installation do you want?" window, click the only
available option Custom (Advanced).

8. In the "Where do you want to install Windows?", if you're installing the server
on a regular IDE hard disk, click to select the first disk, usually Disk 0, and
click Next.(If you're installing on a hard disk that's connected to a SCSI
controller, click Load Driver and insert the media provided by the controller's
manufacturer.)f you must, you can also click Drive Options and manually create
a partition on the destination hard disk.

9. The installation now begins. Copying the setup files from the DVD to the hard
drive only takes about one minute. However, extracting and uncompressing the
files takes a good deal longer. After 20 minutes, the operating system is
installed. The exact time it takes to install server core depends upon your
hardware specifications. Faster disks will perform much faster install windows
Sever 2008 takes up approximately 10GB of hard drive space.
10. Then the server reboots you'll be prompted with the new Windows Server 2008
type of login screen. Press

CTRL+ALT+DEL to log in.


Once the install is finished, were prompted to change our password before logging in.
Windows requires that you have a strong password, seven characters long with at least
three of the four following: uppercase letter, lowercase letter, numeral, or symbol. Youll
want to make sure you write it down somewhere for now, because if you forget it later, the
entire install will have to be re-done.

11. finally, the desktop appears and that's it, you're logged on and can begin working.
You will be greeted by an assistant for the initial server configuration, and after
performing some initial configuration tasks, you will be able to start working.

Result
Practice on Linux commands.
Creating and managing user accounts in LINUX/Windows-2008
server.

Aim: To creatre a user in linux server and assigning rights.

Procedure:

Go to Users and groups application to manage users

In order to create a new user, click add user

Fill in the user info and click ok.

As we can see the new user is created

If we want more user management options select properties

We add the user to a group "linuxers"

The user is added.


Fig :a

Fig b
Fig c

Fig d
Result: Thus the experiment to create a user in Linux server done successfully.
Aim: Creating and managing user accounts in Windows-2008
server.
Local User Account

This section describes how to create a local user account.

1. Click Start, select Administrative Tools and click Computer Management.


2. In Computer Management, click Local Users and Groups.

3. Double click the Users folder.


4. Right click in the users list and click New User.

4 a. Fill in the information for the new user and click Create. You can create another user.
Click Close when you are done creating users.
If the account will be used by a service application like SQL Server, uncheck User must change
password at next logon and check the options below.
User cannot change password
Password never expires

5. You should now see your newly created user accounts. By default, new user accounts are
given limited access permissions.

6. Click Finish.
7. You should now see your newly created user account. By default, new user accounts are given
limited access permissions.

Creating and managing user accounts in Linux

The Process of Creating User Accounts


When you create a user account using the User Manager application, you can manage all
aspects of the user account. For detailed instructions on using User Manager, see the
chapter titled User and Group Configuration in the Official Red Hat Linux Customization
Guide. This section will highlight the multi-step user creation process necessary when using
the command line tools.

There are two steps to creating a user with the command line tools included with Red Hat
Linux:

1. Issue the useradd command to create a locked user account.


2. Unlock the account by issuing the passwd command to assign a password and set
password aging guidelines.

The following steps illustrate what happens if the command /usr/sbin/useradd juan is issued
on a system that has shadow passwords enabled:

1. A new line for juan is created in /etc/passwd. The line has the following
characteristics:

o It begins with the username, juan.

o There is an x for the password field indicating that the system is using shadow
passwords.

o A UID at or above 500 is created. (Under Red Hat Linux UIDs and GIDs
below 500 are reserved for system use.)

o A GID at or above 500 is created.

o The optional GECOS information is left blank.

o The home directory (/home/juan/) is specified.

o The default shell is set to /bin/bash.

2. A new line for a group named juan is created in /etc/shadow. The line has the
following characteristics:

o It begins with the username, juan.

o Two exclamation points (!!) appear in the password field of


the /etc/shadow file, which locks the account.

o The password is set to never expire.

3. A new line for a group named juan is created in /etc/group. A group bearing the same
name as a user is called a user private group. For more information on user private
groups, see the chapter titled Users and Groups in the Official Red Hat Linux
Reference Guide.

The line created in /etc/group has the following characteristics:


o It begins with the group name, juan.

o An x appears in the password field indicating that the system is using shadow
group passwords.

o The GID matches the one listed for user juan in /etc/passwd.

4. A new line for a group named juan is created in /etc/gshadow. The line has the
following characteristics:

o It begins with the group name, juan.

o Two exclamation points (!!) appear in the password field of


the /etc/gshadow file, which locks the group.

o All other fields are blank.

5. A directory for user juan is created in the /home/ directory. This directory is owned by
user juan and group juan. However, it has read, write, and execute privileges only for
the user juan. All other permissions are denied.

6. The files within the /etc/skel/ directory (which contain default user settings) are copied
into the new /home/juan/ directory.

At this point, a locked account called juan exists on the system. To activate it, the
administrator must next assign a password to the account using the passwd command and,
optionally, set password aging guidelines.

It is also possible to configure the account so that during the first log in, the user is asked to
create a password.

Password Security

Creating strong passwords is important for the security of the organization. There are two
options available to enforce the use of good passwords:

The system administrator can create passwords for all users.

The system administrator can let the users create their own passwords, while verifying
that the passwords are of acceptable quality.
Creating passwords for the users ensures that the passwords are good, but it becomes a
daunting task as the organization grows.

It also increases the risk of users writing their passwords down.

For these reasons, system administrators prefer to have the user create their own passwords.
However, a good system administrator actively verifies that the passwords are good and, in
some cases, forces users to change their passwords periodically through password aging.

For guidelines on how to create strong passwords and how to set password aging policies,
see the chapter titled Workstation Security in the Official Red Hat Linux Security Guide.

New User Passwords

If passwords within an organization are created centrally by the administrator, adding new
users to the organization means the administrators must configure the account so the user is
asked to create a password when logging in for the first time.

To configure a user account in this manner, follow these steps:

1. Create the user account using the useradd command. At this point the account is
created, but locked.

2. Force immediate password expiration To do this. type the following command:

chage -d 0

3. This sets the value for the date the password was last changed to the epoch (January 1,
1970). This value forces immediate password expiration no matter what password
aging policy, if any, is in place.

4. Unlock the account There are two common approaches to this. The administrator
can assign an initial password:

/usr/sbin/usermod -p "<password>"

5. In the above command, replace <password> with the initial password.

6. Or, the administrator can assign a null password:

/usr/sbin/usermod -p ""
Creating and managing user accounts in Linux Command Mode
To add a new user account, you can run either of the following two commands as root.

#adduser[new_account]

#useradd[new_account]

When a new user account is added to the system, the following operations are performed.

1. His/her home directory is created (/home/username by default).

2. The following hidden files are copied into the users home directory, and will be used to
provide environment variables for his/her user session.

.bash_logout

.bash_profile

.bashrc

3. A mail spool is created for the user at /var/spool/mail/username.

4. A group is created and given the same name as the new user account.

Understanding /etc/passwd

The full account information is stored in the /etc/passwd file. This file contains a record per
system user account and has the following format (fields are delimited by a colon).

[username]:[x]:[UID]:[GID]:[Comment]:[Homedirectory]:[Defaultshell]
Fields [username] and [Comment] are self explanatory.
The x in the second field indicates that the account is protected by a shadowed
password (in /etc/shadow), which is needed to logon as [username].
The [UID] and [GID] fields are integers that represent the User IDentification
and the primary Group IDentification to which [username] belongs, respectively.
The [Home directory] indicates the absolute path to [username]s home
directory, and
The [Default shell] is the shell that will be made available to this user when he
or she logins the system.

Understanding /etc/group

Group information is stored in the /etc/group file. Each record has the following format.

[Groupname]:[Grouppassword]:[GID]:[Groupmembers]

[Group name] is the name of group.


An x in [Group password] indicates group passwords are not being used.
[GID]: same as in /etc/passwd.
[Group members]: a comma separated list of users who are members of [Group name].

Add User Accounts

After adding an account, you can edit the following information (to name a few fields) using
the usermod command, whose basic syntax of usermod is as follows.

#usermod[options][username]

Setting the expiry date for an account

Use the expiredate flag followed by a date in YYYY-MM-DD format.


#usermodexpiredate20141030tecmint

Adding the user to supplementary groups

Use the combined a G, or append groups options, followed by a comma separated list of
groups.

#usermodappendgroupsroot,userstecmint

Changing the default location of the users home directory

Use the -d, or home options, followed by the absolute path to the new home directory.

#usermodhome/tmptecmint

Changing the shell the user will use by default

Use shell, followed by the path to the new shell.

#usermodshell/bin/shtecmint

Displaying the groups an user is a member of

#groupstecmint

#idtecmint

Now lets execute all the above commands in one go.


#usermodexpiredate20141030appendgroupsroot,usershome/tmp
shell/bin/shtecmint

usermod Command Examples

4.Write and execute at shell programs in Linux using numbers

#!/bin/bash
Function add ()
{
Sum=`expr $a+$b`
echo sum is: $sum;
}
echo a
read a
echo b
read b
c=`expr $a + $b`
echo $c
echo addition of two number
echo enter a number
read a
echo enter a number
read b
c=`expr $a+$b`
echo $c

The output
$chmod .sh
$./add.sh
Enter a number a 25
Enter a number b 30
C is 55

5. Write and execute at shell programs in Linux using strings


#! /bin/bash

# example of using arguments to a script


echo cse dept $1

echo the college BITIT $2

echo total number of argument is $#

the sample out put

$ chmod a+x name.sh

$ ./name.sh the college BITIT of cse dept

Total number of argument is 24


6. Write and execute at shell programs in Linux using arrays

#! /bin/bash
# This script uses while loop to repeatedly prompt the user
# enter a input and stores the input as an element in an array
Index=0
While true
Do
read p e nter a new element: x [$x = ] && break
input array[$index]=$x ((index++))
done
echo the array now contains ${# inputarray[*]}elements

The sample output


$. /fillarray read.sh
Enter a new element: 45
Enter a new element: 20
Enter a new element: 25
Enter a new element: 10
The array now contains 4 elements

7. Lower case to upper case, string length, concatenating strings


8. Installation of device drivers in LINUX/Windows-2008 server

S-ar putea să vă placă și