日期:2014-05-16  浏览次数:20653 次

Linux SSH服务开通[Fedora 12]

近期安装了一台Fedora 12虚拟机, 可以在自己电脑上ssh连接到这台Linux, 用起来很方便. 这里记一下是怎么配置的.

1) 安装openssh-server

[root@localhost ~]# yum install openssh-server
2) 查看是否已成功安装openssh-server

[root@localhost ~]# rpm -qa | grep openssh-server


openssh-server-5.3p1-19.fc12.i686
[root@localhost ~]#


3) 修改ssh服务的配置文件

配置ssh服务的运行参数, 是通过修改配置文件/etc/ssh/ssh_config实现的. /etc/ssh/ssh_config文件的配置选项非常多, 但大部分都已经用"#"注释掉了.

#Port 22?

#Protocol 2,1?

#PermitRootLogin yes?

配置完保存配置文件, 不过如果没什么特殊的要求这都不用配置.

?

1.启动SSH服务

#?systemctl?start?sshd.service

?

2.随系统一起启动服务

#?systemctl?enable?sshd.service

?

3.开启防火墙22端口

#?iptables?-I?INPUT?-p tcp?--dport?22?-j?ACCEPT

?

如果仍然有问题,就可能是SELinux导致的

关闭selinux:

修改/etc/selinux/config文件中的SELINUX=""?为?disabled,然后重启

===================================

[root@CC init.d]# systemctl start sshd.service

[root@CC init.d]# systemctl enable sshd.service
ln -s '/usr/lib/systemd/system/sshd.service' '/etc/systemd/system/multi-user.target.wants/sshd.service'


[root@CC init.d]# iptables -I INPUT -p tcp --dport 22 -j ACCEPT
 
===================================

?