Initial Configurations
Before you install any other application on fresh ubuntu server installation, it's best to do this thing or known this first.Add User to Ubuntu
trusty@dlp:~$sudo adduser ubuntu # add a user "ubuntu"
[sudo] password for trusty: # own password
Adding user `ubuntu' ...
Adding new group `ubuntu' (1001) ...
Adding new user `ubuntu' (1001) with group `ubuntu' ...
Creating home directory `/home/ubuntu' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: # set password for a user
Retype new UNIX password: # confirm
passwd: password updated successfully
Changing the user information for ubuntu
Enter the new value, or press ENTER for the default
Adding new group `ubuntu' (1001) ...
Adding new user `ubuntu' (1001) with group `ubuntu' ...
Creating home directory `/home/ubuntu' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: # set password for a user
Retype new UNIX password: # confirm
passwd: password updated successfully
Changing the user information for ubuntu
Enter the new value, or press ENTER for the default
Full Name []: # if not needed, Enter with empty
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
trusty@dlp:~$
Enabling root User
By default root access in ubuntu is disabled because his password has not set yet, to do that follow this step.
trusty@dlp:~$ sudo passwd root
Enter new UNIX password: # set root password
Retype new UNIX password: # confirm
passwd: password updated successfully
trusty@dlp:~$ su -
Password: # root password
root@dlp:~# # just switched to root account
Enter new UNIX password: # set root password
Retype new UNIX password: # confirm
passwd: password updated successfully
trusty@dlp:~$ su -
Password: # root password
root@dlp:~# # just switched to root account
Setup IP Address
root@dlp:~# vim /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
iface lo inet loopback
auto eth0 # The primary network interface
#iface eth0 inet dhcp # Comment out
# add these lines
iface eth0 inet static
address 10.0.0.30 # define IP address
network 10.0.0.0 # define network address
netmask 255.255.255.0 # define subnet mask
broadcast 10.0.0.255 # define broadcast address
gateway 10.0.0.1 # define default gateway
dns-nameservers 10.0.0.10 # define name server
address 10.0.0.30 # define IP address
network 10.0.0.0 # define network address
netmask 255.255.255.0 # define subnet mask
broadcast 10.0.0.255 # define broadcast address
gateway 10.0.0.1 # define default gateway
dns-nameservers 10.0.0.10 # define name server
# Save and quit with shift+: q [Enter]
root@dlp:~# ifdown eth0 && ifup eth0
Disabled IPV6
root@dlp:~# echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
root@dlp:~# sysctl -p
root@dlp:~# ifconfig Update the System
root@dlp:~# aptitude update # Update list
Ign http://jp.archive.ubuntu.com trusty InRelease Ign http://jp.archive.ubuntu.com trusty-updates InRelease Ign http://jp.archive.ubuntu.com trusty-backports InRelease
..... .....root@dlp:~# aptitude -y upgrade # Upgrade
# or you can use this command
root@dlp:~# apt-get update && apt-get upgrade -y
VIM Installation
Vim is a text editor with more convenience than the default vi in ubuntu.
root@dlp:~# apt-get install vim -y
Sudo Install & Configuration
Sudo is a tools that enable users to do admin or root command and also can be use to separate privileges each user on the system.
root@dlp:~# apt-get install sudo -y
Grant root privileges to users trusty
root@dlp:~# visudo
# add at the last: user 'trusty' can use all root privilege
trusty ALL=(ALL:ALL) ALL
# how to write ⇒ destination host=(owner) command
# push 'Ctrl + x' key to quit visudo
# make sure with user 'trusty'
trusty@dlp:~$ /sbin/shutdown -r now
shutdown: Need to be root # denied normally
trusty@dlp:~$ sudo /sbin/shutdown -r now
[sudo] password for trusty: # trusty's password
Broadcast message from root@dlp (/dev/pts/0) at 17:33 ...The system is going down for reboot NOW!
0 comments:
Post a Comment
Thank you for your kind comment.