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
192.168.20.0/24 dev eth0  proto kernel scope link  src 192.168.20.112
default via 192.168.1.254  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 -
Password:
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 192.168.20.0/24 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 192.168.20.0/24
139,445/tcp (Samba) ALLOW IN 192.168.20.0/24

 

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;
authoritative;
log-facility local7;
option subnet-mask 255.255.255.0;
option broadcast-address 10.10.1.255;
option routers 10.10.1.1;
option domain-name-servers 10.10.1.1;
option domain-name “shareitskills.com”;
subnet 10.10.1.0 netmask 255.255.255.0 {
range 10.10.1.50 10.10.1.200;
}

Restart dhcp service using the following command:

sudo service isc-dhcp-server restart

*** Job Done ***