Sunteți pe pagina 1din 6

configure sudo on linux

[root@localhost ~]# useradd student [root@localhost ~]# passwd student changing password for user student. New UNIX password: BAD PASSWORD: it is based on a dictionary word Retype new UNIX pasword: passwd: all authentication tokens updated successfully. [root@localhost ~]# . . [root@localhost ~]# vi /etc/sudoers (or) [root@localhost ~]# visudo NOTE: Add the following line to the end of the file. student ALL=(ALL) ALL

[root@localhost ~]# exit NOTE: Now login as student user [student@localhost ~]$ sudo tail /var/log/messages . . . password : student . ....... output of log file omitted ......... [student@localhost ~]$ Example to work in sudo [student@localhost ~]$ sudo rpm -Uvh libaio......... [student@localhost ~]$ sudo rpm -Uvh openmotif.........

Configure YUM(YELLOWDOC UPDATE MODIFY) in linux

[root@localhost [root@localhost [root@localhost [root@localhost [root@localhost [root@localhost [root@localhost . . . [root@localhost [root@localhost [root@localhost . . . [root@localhost

~]# mkdir -p /var/ftp/pub ~]# ~]# cd /media/RHEL_5\ i386\ DVD/ RHEL_5 i386 DVD]# RHEL_5 i386 DVD]# cp -R Server/ /var/ftp/pub/ RHEL_5 i386 DVD]# cd Server Server]# rpm -Uvh createrepo-0.4.4-2.fc6.noarch.rpm

Server]# cd ~]# ~]# createrepo /var/ftp/pub/server

~]# vi /etc/yum.repos.d/Server.repo

[server] baseurl=file:///var/ftp/pub/Server enabled=1 gpgcheck=0 :wq [root@localhost ~]# yum clean all . . . . ...........output of log file omitted............ [root@localhost ~]# yum list all . . . .. ...........output of log file omitted............ [root@localhost ~]# yum install dhcp . . . . . . ...........output of log file omitted............ [root@localhost ~]# yum install ftp . . . . ...........output of log file omitted............ [root@localhost ~]#

RAID(Redunant array of inexpensive disk)

In Server side configuration Create a three partition Disk /dev/sdb /dev/sdc /dev/sdd ip address: 192.168.1.131

[root@localhost ~]# fdisk -l . . . [root@localhost ~]# fdisk /dev/sdb . . . command (m for help) : n command action e extended p primary partion (1-4) p partition number (1 -4) : 1 First cylinder (1-130, default 1) : using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-130, default 130) : using default value 130 command (m for help) : l . . command (m for help) : t Selected partition 1 Hex code (type L to list codes) : fd Changed system type of partition 1 to fd (Linux raid autodetect) command (m for help) : w The partition table has been altered ! Calling ioctl( ) to re-read partition table. Syncing disks. [root@localhost ~]# fdisk -l Note : Repeat the same step for another two partition Disks. To create a RAID disk [root@localhost ~]# mdadm -C /dev/md0 -l1 -n2 -x1 /dev/sd{b,c,d} mdadm: array /dev/md0 started . Note:

--level or -l --raid-devices or -n --spare-device or -x To check the RAID disk

= sets the Raid Level. = sets the number of RAID disks. = optionally sets the number of hot spares.

[root@localhost ~]# mdadm -D /dev/md0 . . ........output of log file omitted....... Note : It shows the active disk and spare disk. To Make file system [root@localhost ~]# mkfs.ext3 /dev/md0 . . . To Mount the RAID disk [root@localhost ~]# mkdir /test [root@localhost ~]# mount /dev/md0 /test [root@localhost ~]# To simulate disk failure [root@localhost ~]# mdadm -f /dev/md0 To Disssemble/Stop a disk array [root@localhost ~]# mdadm -S /dev/md0 /dev/sdb

[root@localhost ~]# vi /etc/exports /test *(rw) :wq [root@localhost ~]# service portmap start [root@localhost ~]# service nfs start In Client Side Configuration

[root@localhost ~]# mkdir /share

[root@localhost ~]# mount 192.168.1.131:/test/ /share/ SAMBA SERVER CONFIGURATON [root@localhost ~]# yum install samba . . . Is this ok [Y/N] : y . . . Complete! [root@localhost ~]# vi /etc/samba/smb.conf Note : Search the line myshare using /myshare in vi editor and remove all semi colon myshare comment =Mary's and Fred's stuff path = /tmp valid users = root public =no writable =yes printable = no create mask = 0765 :wq [root@localhost ~]# service smb start [root@localhost ~]# smbpasswd -a root New SMB password : Retype new SMB password : Addded user root. [root@localhost ~]# Note : In windows run prompt type the ip address : 192.168.1.131 It will prompt for user name and password.

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