Configure Secure vsftpd and SSH servers in centos 52

Source: Internet
Author: User
Tags php online vps

My VPs is relatively idle, and the company needs to build a PHP online shop. I can just use my VPs to save a few hundred yuan of Space purchase costs. However, if the website is not managed by me, you need to grant the FTP permission to your colleagues. However, for the sake of server security, SSH user logon needs to be controlled. Colleagues can only see their own directories when logging on to FTP users. How to configure it?

Vsftpd and OpenSSH have been installed before, and how to install these two types of software in centos52 will be searched separately.

1. vsftpd

Because the website users and groups are WWW and WWW, I need to set up a special FTP user

# Mkdir/home/newweb (root directory of the website)

# Useradd-G www-D/home/newweb-M newuser

(Note: G: the user's Group D: Specifies the location where the user's own directory is created. M: No default home directory is created, that is, no home directory exists under/home)

# Chown newuser. www/home/newweb (set the owner of/home/newweb as newuser)

# Chmod-r 775/home/newweb (set the permission to a group that can be read/written)

Configure vsftpd. conf in/etc/vsftpd

You have four options: anonymous_enable = No (anonymous login not allowed) local_enable = Yes, write_enable = Yes, And chroot_local_user = yes!

Restart vsftpd

#/Etc/rc. d/init. d/vsftpd restart

2. Configure SSH

Modify/etc/ssh/sshd_conf and add the following line at the end:

Allowusers root@192.168.1.32 Admin

Note: It is important to list the users who need to log on to the machine; otherwise they will be locked out.

SSH reload its configuration file

/Etc/rc. d/init. d/sshd reload

Configuration complete

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.