centos6.5 安装sshd

来源:互联网 发布:账户系统数据接口规范 编辑:程序博客网 时间:2024/05/18 12:02

#rpm -qa |grep ssh 检查是否装了SSH包

#yum install openssh-server 没有的话,安装SSH服务

#chkconfig --list sshd 检查SSHD是否在本运行级别下设置为开机启动

#chkconfig --level 2345 sshd on  如果没设置启动就设置下

#service sshd restart  重新启动SSHD

#netstat -antp |grep sshd  看看是否启动了22端口,需要确认下

#iptables -nL  看看是否放行了22口

#iptables -I INPUT -p tcp --dport 22 -j ACCEPT 没有的话放行22端口

#iptables save 保存防火墙规则

# vi /etc/ssh/sshd_config    用vi打开SSH的配置文件,在这里我们先保持默认(允许普通用户通过口令登录)

#useradd lhc    添加普通用户(lhc)

#passwd lhc     修改lhc密码


原文地址http://www.centoscn.com/image-text/config/2016/0604/7369.html