Tag Archives: linux server

Keep PuTTY SSH Sessions from Disconnecting

If you are using PuTTY to interact with your Linux Server(s) for extensive period of time and are frustrated due to disconnecting, when the SSH session turns idle for a certain amount of time (usually ~10 min). To overcome this problem, just use the keepalive feature of PuTTY!

Click on the Connection and enter the 30 (or whatever value which indicates the number of seconds) in Seconds between keepalives (0 to turn off) text box.

putty

You are done, from now onward, the keepalive feature will prevent your SSH session from disconnecting.

Hope this will help you!

Please Remember me in your prayers!

Advertisements

How to Fix Postfix File too large error

Today, I was getting an error from my Postfix mail server, when trying to send mysqldump file which is about 8 MB attachment. I checked the /var/log/maillog and found this:

sudo tail -f  /var/log/maillog

1

To view the default settings for all the parameters of Postfix:

postconf -d | grep size

2

Read more of this post

How to add 2nd Hard drive to Ubuntu

To add/mount the second hard drive into Ubuntu, open up the terminal window and type:

sudo fdisk -l

Where sdb is our newly added Secondary Harddisk!

To create the partition on the second Hard drive, use the following command and follow the “on screen” instructions:

sudo fdisk /dev/sdb

Use the partprobe command to update the kernel with the changes:

sudo partprobe /dev/sdb

Where /dev/sdb is my device name, you can use your’s!

Now we need to format our newly created partition using the following command:

sudo mkfs /dev/sdb1 -t ext4

Verify the newly created partition:

sudo fdisk -l

Next you need to create a directory for a mount point:

cd /mnt/
sudo mkdir 2ndHDD 
sudo chmod 0777 2ndHDD
ls -l

Next, mount the newly created sdb1 parition into 2ndHDD directory:

sudo mount /dev/sdb1 /mnt/2ndHDD -t ext4

Updated: Run this command once more:

sudo chmod 0777 2ndHDD

Now, we make a test that we can write a file on to the new drive:

touch /mnt/2ndHDD/test.txt
ls /mnt/2ndHDD/* 

Next time, when we will reboot the computer, it will be gone. If we want to mount new hard drive permanently then we need to edit the fstab file:

sudo nano /etc/fstab

Add this line at the end of the fstab file(you can adjust it according to your requirement):

/dev/sdb1 /mnt/2ndHDD ext4 defaults 0 0

Use this command or else reboot your computer:

sudo mount –a

Hope this will help you!

Please Remember me in your prayers!

%d bloggers like this: