How to Remove Kerberos Password in Linux

This is a very rare situation one might face. Suddenly your linux based computer, VPS or server might prompt you to enter Kerberos Password. Same thing happened to me, I don’t remember if I had set kerberos password in the past. I had only updated certain packages. This happened when I tried assign new password to an existing vsftpd user. In this case all I could think of is getting rid of Kerberos password to proceed with my work.

Kerberos password is network authentication protocol which allow nodes communicating over a non-secure network to prove their identity to one another securely. Now to get rid of Kerberos password, all we need to do is removing a package that causes the issue. However this is a security feature that one might use if they are conscious about their data.

To remove Kerberos Password in Linux:

sudo apt-get remove –purge libpam-krb5

This will now remove the kerberos password.

Category: Linux | Comments Off on How to Remove Kerberos Password in Linux

How to change the Hostname in Ubuntu

There are times you may come up with a need for change in your computer’s identity over network. This is when you will have to change the Hostname of your computer. The hostname is pretty much like a label to your computer or the device for identification over the network. The hostname can be just a simple name, an IP Address or even a domain name.

To change the hostname in Ubuntu, follow these simple steps:

1. Find out your existing hostname by entering this command in terminal:

hostname

hostname ubuntu

So on my computer, the hostname is “santhosh-desktop”

2. Change the hostname by editing:

sudo nano /etc/hostname

You will see the existing hostname. Change it to whatever new hostname you want and save it by hitting Ctrl + O

In this tutorial, I change it to

gigacore-desktop

3. Now edit the hosts:

sudo nano /etc/hosts

Here change the ::1 and 127.0.1.1 to the new hostname you chose.

::1 gigacore-desktop localhost6.localdomain6 localhost6
127.0.1.1 gigacore-desktop

3. Restart the hostname service.

sudo /etc/init.d/hostname restart

Now check the hostname by following the step 1 and you should see the new hostname.

Category: Linux | Comments Off on How to change the Hostname in Ubuntu

How to install and configure vsftpd

This tutorial focuses on how to setup vsftpd server on your linux based VPS or a dedicated server. The vsftpd stands for “Very Secure FTP Daemon”. It is not just secure as the name suggests but also delivers excellent performance by consuming less memory. The tutorial also teaches you how to configure by adding ftp users and locking the directory to individual users.

You can install vsftpd on Ubuntu / Debian, CentOS /Fedora and RHEL linux.

Installing vsftpd on Ubuntu or Debian

sudo apt-get install vsftpd

Installing vsftpd on CentOS / Fedora

yum install vsftpd

How to configure vsftpd:

Now that you’ve installed vsftpd, follow this procedure to configure it. These steps applies for both the linux variants.

Before you get started, stop the vsftpd by typing:

service vsftpd stop

Edit the vsftp.conf

In Ubuntu / Debian:

vi /etc/vsftpd.conf

In Red Hat / CentOS

vi /etc/vsftpd/vsftpd.conf

Make the following changes:

We don’t want anonymous login:

anonymous_enable=NO

Enable local users:

local_enable=YES

The ftpuser should be able to write data:

write_enable=YES

Port 20 need to turned off, makes vsftpd run less privileged:

connect_from_port_20=NO

Chroot everyone:

chroot_local_user=YES

set umask to 022 to make sure that all the files (644) and folders (755) you upload get the proper permissions.

local_umask=022

Now that basic configuration is complete, now let us begin with locking / securing a directory to user.

sudo useradd -d /var/www/path/to/your/dir -s /usr/sbin/nologin ftpuser

Setup a password for the user:

sudo passwd ftpuser

In order to enable the ftpuser read and write the data in your home dir, change the permission and take ownership:

sudo chown -R ftpuser /var/www/path/to/your/dir
sudo chmod 775 /var/www/path/to/your/dir

Create userlist file and add the user:

Ubuntu / Debian:
vi /etc/vsftpd.userlist

CentOS / Fedora

vi /etc/vsftpd/vsftpd.userlist

and add the user:

ftpuser

save the file and open the vsftp.conf file again:

vi /etc/vsftpd.conf

Add the following lines at the end of the file and save it:

# the list of users to give access
userlist_file=/etc/vsftpd.userlist

# this list is on
userlist_enable=YES

# It is not a list of users to deny ftp access
userlist_deny=NO

After completing all these procedures it is almost ready to use it, give it a try but you will get a 500 OOPS permission denied error. To fix it you need to add a nologin to the shell set.

vi /etc/shells

The file should look like this:

/bin/ksh
/usr/bin/rc
/usr/bin/tcsh
/bin/tcsh
/usr/bin/esh
/bin/dash
/bin/bash
/bin/rbash

Add this line at the end:

/usr/sbin/nologin

Now create a usergroup and add the ftpuser to it:

sudo addgroup ftpusers
sudo usermod -Gftpusers ftpuser

Now start the vsftpd:

service vsftpd start

That’s it. Now you have a secure installation of vsftpd on your server.

(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//connect.facebook.net/en_US/all.js#xfbml=1”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));

Category: Linux | Comments Off on How to install and configure vsftpd

How to start, stop and restart MySQL in Ubuntu

mysqlThere are times when you will be forced to start, stop or restart your MySQL server, be it on your VPS or on your localhost. And like every other linux distribution, Ubuntu also comes with a shell script that lets you to do this.

All you need to do is to login as a root or make use of sudo. Open the terminal or login to your VPS and perform these commands:

To start MySQL:

sudo /etc/init.d/mysql start

To stop MySQL:

sudo /etc/init.d/mysql stop

To restart MySQL:

sudo /etc/init.d/mysql restart

Category: Linux | Comments Off on How to start, stop and restart MySQL in Ubuntu