Shell script for changing the SSH port ?

Discussion in 'Tutorials and Guides' started by Benny_D, May 24, 2018.

  1. Benny_D

    Benny_D Member

    92
    3
    Aug 10, 2016
    Any tutorial to change the SSH port using shell script ?
     
  2. MVPSNET

    MVPSNET New Member

    10
    0
    May 18, 2018
    sed -i 's/#Port 22/Port 5522/g' /etc/ssh/sshd_config

    You'll need to restart the ssh daemon afterwards.
     
  3. Benny_D

    Benny_D Member

    92
    3
    Aug 10, 2016
    Thank you.. It works but I want to change it by using shell script not through cmd