Home > Ubuntu > Common Setup Commands for Ubuntu 12.x onwards

Common Setup Commands for Ubuntu 12.x onwards

To change the hostname of the machine
sudo nano /etc/hostname

sudo nano /etc/hosts

To change the IP Address of the machine

sudo vi /etc/network/interfaces

auto eth0
iface eth0 inet static
        address 192.168.1.100
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        dns-nameservers 8.8.8.8 8.8.4.4

sudo /etc/init.d/networking restart

To change the account password

passwd

To shutdown the machine

sudo shutdown –h 0

 

To install and enable openssh

sudo apt-get update
sudo apt-get install openssh-server
sudo ufw allow 22

 

sudo nano /etc/ssh/sshd_config
# line 28: uncomment and change ‘no’
# default setting "without-password" means that root login is permited but require keys authentication
PermitRootLogin no

 

sudo initctl restart ssh

Categories: Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: