Ubuntu has no password set for the root user by default.

# sudo -i

To gain root access you have to type in your own user password. This is the password you set for the first user while installing Ubuntu.

To manually set a password for the root user, type in the following in the shell:

# passwd
 Enter new UNIX password: and Retype new UNIX password:


How to assign static IP in Ubuntu Linux.

My linux system got the IP from DHCP, during my installation I let to get from DHCP. Edit the interfaces file to assign the static ip;

root@ubuntu:~#vim /etc/network/interfaces

change the values in the following format as per your network ip address;



Selecting the server components in Ubuntu Linux after installing

I did the Ubuntu linux server installation in VMware workstation and it hasn’t given the option to select any of the server components. Any way if you want to select and install individaul packages use the command tasksel which will allow to install one or more of the following predefined collection of software in Ubuntu server.

root@ubuntu:~# tasksel



How to check ip address in linux

Easy command is

# ip ro , instead of  –  ifconfig, basically it is trying to show the routing path with interface IP.

root#ulinux:~$ ip ro dev eth0  proto kernel scope link  src
default via  dev  eth0  metric  100


How to enable root user account in Ubuntu

In Ubuntu Linux root account has been disabled by default and you will get authentication failure error message when you try to login,

$ su -
su: Authentication failure

you can enable the root account by following,

$ sudo passwd root
[sudo] password for ramesh:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully


How to enable firewall rule for samba in Ubuntu

sudo ufw enable

# sudo ufw allow from to any app Samba

# sudo ufw status verbose

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing)
New profiles: skip

To Action From
— —— —-
137,138/udp (Samba) ALLOW IN
139,445/tcp (Samba) ALLOW IN


Use logging to find out if you’re blocking a port that should not be blocked.

tail -f /var/log/ufw.log

to add linux user to samba user # smbpasswd -a sajin




Installing DHCP Server in Ubuntu

Credit: http://rbgeek.wordpress.com/2012/04/29/how-to-install-the-dhcp-server-on-ubuntu-12-04lts/

sudo apt-get install isc-dhcp-server

sudo vi /etc/default/isc-dhcp-server

Change “eth0” to the interface on which you want that your server will listen for dhcp request (In my case, it iseth1):

It’s always a good practice to make a backup copy of /etc/dhcp/dhcpd.conf file:

sudo cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak

Change the default configuration by editing /etc/dhcp/dhcpd.conf

ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
option subnet-mask;
option broadcast-address;
option routers;
option domain-name-servers;
option domain-name “shareitskills.com”;
subnet netmask {

Restart dhcp service using the following command:

sudo service isc-dhcp-server restart

*** Job Done ***