1. Fedora starts the sshd service:
1. Check whether the SSH service is installed:
[[Email protected] ~] # Rpm-Qa | grep openssh-Server
Openssh-server-5.3p1-19.fc12.i686 (this line indicates installed)
If the SSH service is not installed, enter:
# Yum install OpenSSH-Server
Install
2. modify the configuration file
# Vi/etc/ssh/sshd_config
# Port 22: The listening port number. The default value is 22, which can be customized.
# Protocols supported by Protocol 2. The default setting is good and you do not need to modify them.
# Permitrootlogin yes: whether to allow direct root logon. It is best to set this parameter to No.
# Maximum number of mmaxauthtries 6 logins. The default value is 6. We recommend that you set this value to 3 to prevent other users from failing to use their passwords.
After modifying the configuration, restart the SSH service:
[[Email protected] ~] #/Etc/rc. d/init. d/sshd restart
Stopping sshd: [OK]
Starting sshd: [OK]:
3. view the sshd status:
# Service sshd status
4. Add port 22 (or other custom ports) to the firewall settings and mark it as accept.
# Iptables-A input-p tcp -- dport 22-J accept
(This sentence is very important, otherwise the external connection will fail .)
You can also add the above parameters to the firewall configuration:
# Vi/etc/sysconfig/iptables
Add:-A input-M state -- state new-m tcp-p tcp -- dport 22-J accept
Save and restart iptables.
For more information, see iptables usage.
Ii. Start sshd service in fedora15/16/17:
Since fedora 15/16 uses the systemd service,
1. Starting the SSH service is somewhat different from the above
# Systemctl start sshd. Service
Or # service sshd start
You can also use restart and stop to control the sshd service.
2. Set to enable the service when the system starts.
# Systemctl enable sshd. Service
3. You also need to enable port 22 of the firewall.
# Iptables-A input-p tcp -- dport 22-J accept
You can also add the above parameters to the firewall configuration:
# Vi/etc/sysconfig/iptables
Add:-A input-M state -- state new-m tcp-p tcp -- dport 22-J accept
Save and restart iptables.
For more information, see iptables usage.
Fedora starts the SSH service