Tag Archives: 12.04

How to install Samba server on Ubuntu 12.04

Part 1: Configuring anonymous share with samba server

To install the samba package,enter the following command:

sudo apt-get install samba samba-common

Check the version of installed samba software by using this command:

smbd --version

Also install these suggested packages for samba:

sudo apt-get install python-glade2 system-config-samba

Go to your Windows machine and use this command in order to check the WORKGROUP name:

net config workstation

It will show the output, something like this:

Backup the smb.conf file, then delete it and create the new one:

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak 
sudo rm /etc/samba/smb.conf 
sudo touch /etc/samba/smb.conf 
sudo nano /etc/samba/smb.conf

Add this, in your smb.conf file (or change it according to your requirement):

#======================= Global Settings ===================================== 
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ============================== 
[MyShare]
path = /samba/share 
browsable =yes
writable = yes
guest ok = yes
read only = no

Save the smb.conf file and restart the service:

sudo service smbd restart

Access the samba share from windows (where ubuntu is the name of my samba server):

wao, we are able to access the samba share successfully 🙂

Let’s try to create something, inside the share folder:

Error, we cannot create anything inside the share folder 😦

Check the current permission on the samba share:

cd /samba/
ls -l

Change it, in such a way that everyone can read and write it(Check it, that it is allowed in your environment or not):

sudo chmod -R 0777 share
ls -l

Try to create something again, inside the share folder:

Verify the newly created file on samba server:

cd share/
ls -l 


Part 2: Add and manage users and groups

Add a group in your ubuntu server (in my case smbgrp):

sudo addgroup smbgrp

Create a new share, set the permission on the share ,add the user to the samba group and create samba password:

cd /samba/
sudo chown -R arbab:smbgrp secure/ 
ls -l 
sudo chmod -R 0770 secure/
ls -l
sudo adduser arbab smbgrp
sudo smbpasswd -a arbab

Add the newly created samba share in smb.conf file:

[secure]
 path = /samba/secure
 valid users = @smbgrp
 guest ok = no
 writable = yes
 browsable = yes

Restart the samba service and check the syntax error with testparm:

sudo service smbd restart 
sudo testparm

Testing from Windows Machine:

Verification from Ubuntu server:

cd /samba/secure/
ls -l

Hope this will help you!

Please Remember me in your prayers!

Enjoy 🙂

How to install Java 6 on Ubuntu 12.04

First, we will check that java is already install or not on our system:

java -version

As, we can see that the java is not install on our system, so we will downloads the Java binary installer from Oracle. (In this example, we will download & install the jre, but the procedure is exactly the same for jdk).

Transfer the downloaded file (jre-6u31***) to the Ubuntu from Windows machine using WinSCP.

Now, move to the directory where you copy the jre file(in my case, it is in tmp directory)

cd /tmp/

Give execute permission to jre file.

sudo chmod +x jre-6u31-linux-x64.bin

Run the jre file.

sudo ./jre-6u31-linux-x64.bin

After execution, it makes a new directory in the same location where jre file reside.

Move this newly created directory to /usr/lib/jvm/

sudo mv jre1.6.0_31 /usr/lib/jvm/

Enter this command:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.6.0_31/bin/java" 1

We are done!

Check the installed version of java.

java -version

Confirmation (Optional 🙂 ):

Here is a confirmation that we successfully installed the java on Ubuntu 12.04.

Hope this will help you!

Please Remember me in your prayers!

Step by Step tutorial to install Ubuntu Server 12.04

I hate to write the long articles, so I will make it short and sweet.

First, download the server version of Ubuntu from here,create the CD and boot the machine with the CD:

Once you successfully boot from CD, it will present you with the following screen in order to select your desired language and then press [Enter]

Select “Install Ubuntu Server

Select the language, you would like to use for the install

Select your Country/City

It’s time to detect your keyboard layout. If you want to detect it then select “Yes” or else use the predefined one by using the “No” option.

Choose the Keyboard layout from pre-defined list

Choose a hostname for Ubuntu Server

Setting up username and password

It will show you warning if you are using the weak password

Select “Yes“, if you want to encrypted private directory (but I will use No)

If it finds the correct time zone for your location you can select Yes. If it says none or is not the time you wish to use, select No.

You have to partition your hard disk before use it, here I am using the “use entire disk” option

Configuring the package manager and select continue

Select how do you want to update your sever

Select the software that you wish to install by highlighting them and hitting the spacebar

Select Yes to install the grub in the master boot record

Installation complete message here, you need to remove the CD

After reboot, Login to the server by entering the username and password you created during installation

Hope this will help you!

Please Remember me in your prayers!

%d bloggers like this: