Showing posts with label Linux/Unix. Show all posts
Showing posts with label Linux/Unix. Show all posts

Saturday, 8 September 2018

How to configure SSH Server on Ubuntu

1. Installing SSH Server:
  • openssh-server package can be found in linux software center. Alternatively open terminal and run below command.
          sudo apt-get install openssh-server

2. Enabling SSH on Ubuntu:
  • Once ssh installed on the machine create backup of sshd_config file with sshd_config.defaults filename to restore in case configuration is messed up.
       sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.defaults
    
    Change permission of defaults backup file using chmod command given             below.
    sudo chmod a-w /etc/ssh/sshd_config.defaults

3. Restart/Reboot SSH Server
  • For Ubuntu 14.04 and below version
    sudo restart ssh
  • For Ubuntu 15.04 and above version
    sudo systemctl restart ssh

Now you will be able to connect to ubuntu using any ssh client application like PuTTY, Bitvise, winscp etc. Just follow below steps.
  • Check ip details using ifconfig command.
  • Use inet addr address and login to ssh client using user and password.







Thursday, 11 January 2018

Enable/Disable iptables firewall in linux

Enable/Disable iptables firewall in linux:
# /etc/init.d/iptables save
# /etc/init.d/iptables stop
# /etc/init.d/iptables start

On Boot:
# chkconfig iptables off

# chkconfig iptables on