Wednesday 19 February 2014

Changing Hostname in Ubuntu

 

To change the hostname in ubuntu permanently you have to edit two files.

The first one is the file “hostname” located in the folder “/etc”. To edit this file using vi you can use the command “sudo vi /etc/hostname” in the terminal. To edit the file in gedit you can use the command “sudo gedit /etc/hostname”. No change the name given in this file and save the same.

After that you need to change one more file. Open the file “hosts” in the location “/etc’'. Edit this file and change the line containing the old hostname to new one. After that save the file. For editing you can either use the “vi” or “gedit” as mentioned in the previous paragraph. Just change the file path and name in that command.

Now restart ubuntu. It will be having the new name now.

Saturday 15 February 2014

Creating a desktop shortcut for FTP access in Ubuntu


Create a “<filename>.desktop” file with the following entries. Replace “<filename>” with suitable name.




[Desktop Entry]
Name=FTP
Exec=nautilus --new-window ftp://<FTP Site Address>
Icon=system-file-manager
Type=Application






Give the file executable permission. On double clicking the file now the FTP site will be opened in nautilus.

Thursday 13 February 2014

Ubuntu Server Setting IP Address by Editing “Interfaces” File


First login to Ubuntu server. Ubuntu server stores the configuration of network interfaces in the file “/etc/networks/interfaces”. To view the content of the file use the command “cat /etc/networks/interfaces”. So let see and example file in the below picture.

Here as can be seen there are two interfaces. The one with the name “lo” is the loopback interface. The other with the name “eth0” is the real interface connected to this machine. Here it is set to “DHCP” as shown by the line “iface eth0 inet dhcp”.
Now let us check the IP obtained by the machine. For this we have to use the command “ifconfig”. The ip as shown by the command is depicted in the picture below.

Now let us edit the file “/etc/networks/interfaces” to set the IP address to static. We will set the IP address to “192.168.56.105”. Here we assume the network interface is taken as “eth0”. For this you have to add the following lines as shown in the picture below:
[Use the command “sudo vi /etc/networks/interfaces” to edit the file]
auto eth0
iface eth0 inet static
address 192.168.56.105
netmask 255.255.255.0
gateway 192.168.56.1

After this save the file. (Hope you are familiar with vi editor).  Now to have the settings take effect you need to restart the service named “networking”. For this use the command “sudo service networking restart”. After that let us check the ip again using the “ifconfig” command”". See the picture below:

Now the IP has changed. Now let us ping to “google.com” and see the result. [I have Internet access from this system. Otherwise this ping won’t work. You can ping to your domain computers if yours is internal network]

My God no ping. I had set the network interface with IP, so what is the problem. Oh! I forget to set dns entries. OK let us add the same to the file “/etc/networks/interfaces”. For this you have to add the line “dns-nameservers <ip1> <ip2>”. Normally two ips for dns that is why. You can any number of ips separated by spaces.

Now restart the “networking” service again. Let us check the content of “/etc/resolv.conf” file by using the command “cat /etc/resolv.conf”.

You can see the dns server entries are now in this file. Don’t edit this file directly as it is generated dynamically on every reboot.
Now let us again ping to ”google.com”.

Got the ping. Now everything is working fine.

Installing Kubuntu in Virtualbox

As I have mentioned in my other posts describing the Installation of Ubuntu in Virtualbox, first create a VM for installing Kubuntu. Then add the “iso” file the CD Drive for the system. Start the VM.
It will bring the first screen of Kubuntu as shown below

Select the option “Start Kubuntu” (which will be selected by default) and press Enter to continue. The below screen shows the loading of Kubuntu.

As shown below after loading Kubuntu, it will directly take you to the Welcome screen. There you have the option to wither try the live CD or Install Kubuntu. Click on “Install Kubuntu”.

The next screen will be the “Prepare” screen. Here Kubuntu will check whether the minimum disk space is available as well as whether Internet is available. Also you have the choice to select the installation of third-party software as well as downloading updates. Here we haven’t selected any of this option.

The next screen is “Disk Setup” where you will setup the partitions. Here if you select “Manual”, you will be shown screen for creating partitions manually. We have selected “Guided – use entire disk” option. So everything will be done automatically by Kubuntu. After doing that click on “Install Now”.

On clicking the “Install Now” button in the above screen, Kubuntu starts creating partitions which will be shown in the same screen as a progress bar at the bottom. This is shown in the picture below.

After creating partitions it will move to the next screen named “Timezone”. Here you can set the time zone. You can either select the same from combo box or by clicking the map. After that click on “Continue”. Kubuntu will be copying the files to the Hard disk in the background at the same time.

The next screen is the “Keyboard” screen. Select the appropriate keyboard here and click on “Continue”

Next is the “User Info” screen. Enter the name, username, password and computer name in this screen. Also set the options like whether you want to “log in automatically” or “require password to log in” as well as to “Encrypt the home folder or not”. After that click on “Continue”.

This will take you to the last screen. Now you will waiting for the installation to complete.

As you can see below the installation has completed and now it is asking for a restart. Click on the “Restart Now” button.

Vow, after restarting you will be taken to the nice, beautiful login screen of Kubuntu. Just enter the password and login.

Now Kubuntu is loading the necessary services. After that it will take you to the desktop.

The beautiful Kubuntu desktop. I love this desktop. So cute.