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