Fedora starts the SSH service

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.