Technofunction

Adding swap space in Redhat/Fedora Linux Manually using File and Partition

Linux divides the physical Memory RAM (random access memory) into chucks of memory called pages. Swapping and paging algorithms is the process where a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. Having sufficient swap space enables the system to keep some physical memory free at all times.

There are two important reasons of using the swap space i.e.

  1. When the system requires more memory than is physically available(RAM), the kernel swaps out less used pages and gives memory to the current application (process).
  2. A significant number of the pages may be  used by an application during its startup phase only for initialization and then never used again. The system can swap out those pages and free the memory for other applications.

This swap space is allotted at the time of system installation and generally selected to be twice the system memory in case of Desktops PC and Half the size of system memory in case of Servers but you may vary it according to your requirement.

(more…)

Resetting/Recovering forgotten root password in Redhat/CentOS Linux

If a user forgets its password in Linux than it can easily be changed by a system administrator for the user. But what if somehow you forgot your root password and cant enter in the system as superuser(root). Now if you have a sudo permission for a user than you may change the root password through that user. But if that is not the case than you can still change your root password. This is possible by entering in the Linux server via single user mode.

Just follow the steps to reset your root password:

  • Simply boot the Linux and when you get the GUI screen for booting Linux press “enter”. You should get a screen as shown below. In case you don’t have GUI version you should still get a choice of selecting the OS to boot if you have grub boot loader installed in that case simply move to next step.

(more…)

Configuring Samba Server to share file/directory in RHEL5

As discussed in my earlier post that samba service can be used to share file,directory , printer in an enterprise Lan environment both in Linux as well as Windows workstations. You can read more about samba service here.

But before using samba you need to configure it. So we would start with installing samba using yum service. Than we will directory edit the configuration  file using editor. And than we would do it graphically. You can read about creating yum repository in Rhel5 here. You need to enter via the user root or atleast have permission to perform these operations.

Scenario:- we have 2 servers running Rhel5 and are connected in a network. We want to share some files so that remote server can access the files and directory via samba. But this should not be public and moreover only a registered user ankit is able to login on the server were files are originally located. And user ankit can also put or write to the files in directory. We have one server with ip 192.168.85.136 were files are located and second one has ip 192.168.85.133 were we want to access the files . Obviously try to ping both machines since the machine must see each other in order to communicate with each other.

Simply follow the steps as discussed below:

  • Install the samba service using yum.

# yum install samba* -y

  • Next you need to edit the configuration file. which can be found in /etc/samba/smb.conf

# vi /etc/samba/smb.conf

There are 3 things to be specified in here

  1. You need to specify the Workgroup for samba.
  2. You need to configure hosts ip’s that can access the samba service. Ip other than you specified will automatically be rejected.
  3. You need to specify the directories that you want to share across the network all the files you need to share must be in this directory. Further you may assign the permission to this directory.
  • to start with go to line number 74 and 80

Line 74        workgroup = SMBGROUP

Line 80         hosts allow =  192.168.

(more…)