• CentOS SSH Installation And Configuration


    CentOS SSH Installation And Configuration

    CentOS SSH Installation And Configuration

    by Vivek Gite on March 14, 2009 · 3 comments

    How do I install and configure ssh server and client under CentOS Linux operating systems?

    You need to install the following packages (which are installed by default until and unless you removed it or skipped it while installing CentOS)

    • openssh-clients : The OpenSSH client applications
    • openssh-server : The OpenSSH server daemon

    OpenSSH Installations under CentOS Linux

    To install the server and client type:
    # yum -y install openssh-server openssh-clients
    Start the service:
    # chkconfig sshd on
    # service sshd start

    Make sure port 22 is opened:
    # netstat -tulpn | grep :22

    Firewall Settings

    Edit /etc/sysconfig/iptables (IPv4 firewall),
    # vi /etc/sysconfig/iptables
    Add the line
    -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
    If you want to restict access to 192.168.1.0/24, edit it as follows:
    -A RH-Firewall-1-INPUT -s 192.168.1.0/24 -m state --state NEW -p tcp --dport 22 -j ACCEPT
    If your site uses IPv6, and you are editing ip6tables, use the line:
    -A RH-Firewall-1-INPUT -m tcp -p tcp --dport 22 -j ACCEPT
    Save and close the file. Restart iptables:
    # service iptables restart

    OpenSSH Server Configuration

    Edit /etc/ssh/sshd_config, enter:
    # vi /etc/ssh/sshd_config
    To disable root logins, edit or add as follows:
    PermitRootLogin no
    Restrict login to user tom and jerry only over ssh:
    AllowUsers tom jerry
    Change ssh port i.e. run it on a non-standard port like 1235
    Port 1235
    Save and close the file. Restart sshd:
    # service sshd restart

  • 相关阅读:
    关于GDI+的图片质量
    断点续传的Demo
    offic2007 ,offic2010安装失败 1935错误处理方案
    Easy Slider幻灯片 API
    Lazyload.js延迟加载效果
    MVC3中 多种跳转方式总结
    MVC中 DropDownList编辑默认选中的使用
    ASP.NET Session的七点认识
    easyui 的datagrid的自适应宽度的问题
    Linux常用文件操作高频使用命令
  • 原文地址:https://www.cnblogs.com/lexus/p/2364171.html
Copyright © 2020-2023  润新知