Centos 6.2 initial environment setup after system installation centos 6.2 install OpenSSH servercentos set the service to automatically start upon startup

Source: Internet
Author: User
Tags openssh server
ArticleDirectory
    • Security Settings
    • Configure OpenSSH server
    • Update and install new software packages

After installing the system according to "minimum Virtual Machine installation centos 6.2", we also need to perform some initialization settings.

 

Security Settings

Because the root user has full operation permissions on the system, in order to avoid some mistakes, we recommend that you log on to the system as a general user. If necessary, you need root operation permissions, then, run the "Su-" command to log on as the root user.

 

Use the useradd command to create a new user named amonest:

 
Useradd amonest

Then use the passwd command to set the password:

 
PasswdAmonest

 

Generally, you can log on as the root user to configure the system as Administrator by executing the "Su-" command and entering the correct root password. However, in order to further enhance the security of the system, it is necessary to establish an Administrator group that only allows users in this group to execute the "Su-" command to log on as the root user, users in other groups cannot Log On As root even if they execute "Su-" and enter the correct root password. In UNIX, the group name is usually "Wheel ".

 

EditIn the/etc/PAM. d/su file, locate the following line, remove the comment and save it:

 
# Auth required/lib/security/$ ISA/pam_wheel.so use_uid

Then run the following command:

 
Echo "Su_wheel_only Yes">/Etc/Login. Defs

Finally, use the usermod command to add a new user to the wheel group:

 
Usermod-G wheel amonest

 

After completing the preceding operations, you can create a new user. Then, you can use the new user to test the user. If the user is not added to the wheel group, run the "Su-" command, even if you enter the correct root password, you cannot log on as the root user.

 

After a new user is created, all subsequent operations should be performed as new users.

 

For more detailed settings, refer to "initial environment settings after system installation".

 

Configure OpenSSH server

The SSH service can be remotely managed without having to run to the front of the server every time. Centos 6.2 is installed with sshd by default. This service is automatically started after the server is started.

 

Run the chkconfig command to view the sshd service information:

 
$ Chkconfig --List sshdsshd0: Off1: Off2: On3: On4: On5: On6: Off

 

For more information, see install OpenSSH server in centos 6.2 and enable centos to automatically start the service.

 

Update and install new software packages

After the system is installed, it is necessary to check whether the software package needs to be updated:

$ Yum check-Update... Bash. x86_644.1.2-9. El6_2 updateschkconfig. x86_641.3.49.3-1. El6_2 updatescurl. x86_647.19.7-26. El6_2.4Updates ......

 

Run the yum update command to update all software packages:

 $ Yum update ...... ========================================================== ========================================================== Package arch version repository size ========================================================== ========================================================== Installing: Kernel x86_64  2.6 . 32 - 220.23 . 1 . El6 updates 24  Mupdating: Bash x86_64  4.1 . 2 - 9 . El6_2 updates 903  K chkconfig x86_64  1.3 . 49.3 - 1 . El6_2 updates 159  K curl x86_64  7.19 . 7 - 26 . El6_2. 4 Updates 192  K ...... 
Related Article

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.