Help for this page

Select Code to Download


  1. or download this
    my $sshport;
    while ( $sshport !~ /^[1-9]\d+$/ || $sshport > 65535 ) {
       print " Please Enter valid ssh port number:\n";
       chomp( $sshport = <STDIN> );
    }
    
  2. or download this
    while (<SSHD_CONFIG>){
        s/^Port.+/Port $sshport/i;
        s/^#Port\s.+/Port $sshport/i;
        print SSHD_CONFIG_NEW $_;
    }
    
  3. or download this
    rename('sshd_config','sshd_config.old')
        or die "Can't rename sshd_config: $!";
    rename('sshd_config.new','sshd_config')
        or die "Can't rename sshd_config.new: $!";