Guest User

Untitled

a guest
Aug 29th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. # yum install vsftpd
  2.  
  3. # mkdir /var/ftp/pub/upload
  4.  
  5. # cat vsftpd.conf
  6. listen=YES
  7. anonymous_enable=YES
  8. local_enable=YES
  9. write_enable=YES
  10. xferlog_file=YES
  11.  
  12. #anonymous users are restricted (chrooted) to anon_root
  13. #directory was created by root, hence owned by root.root
  14. anon_root=/var/ftp/pub/incoming
  15. anon_upload_enable=YES
  16. anon_mkdir_write_enable=YES
  17.  
  18. #chroot_local_user=NO
  19. #chroot_list_enable=YES
  20. #chroot_list_file=/etc/vsftpd.chroot_list
  21. chown_uploads=YES
  22.  
  23. # cat /etc/sysconfig/selinux
  24. SELINUX=disabled
  25. SELINUXTYPE=targeted
  26. SETLOCALDEFS=0
  27.  
  28. # sestatus
  29. SELinux status: disabled
  30. # getenforce
  31. Disabled
  32.  
  33. # grep ftp /etc/passwd
  34. ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
  35.  
  36. # ll /var/
  37. drwxr-xr-x 4 root root 4096 Mar 14 10:53 ftp
  38.  
  39. # ll /var/ftp/
  40. drwxrwxrwx 2 ftp ftp 4096 Mar 14 10:53 incoming
  41. drwxr-xr-x 3 ftp ftp 4096 Mar 14 11:29 pub
  42.  
  43. listen=YES
  44. local_enable=YES
  45. write_enable=YES
  46. xferlog_file=YES
  47.  
  48. #anonymous users are restricted (chrooted) to anon_root
  49. anonymous_enable=YES
  50. anon_root=/var/ftp/pub/incoming
  51. anon_upload_enable=YES
  52. anon_mkdir_write_enable=YES
  53.  
  54. #500 OOPS: bad bool value in config file for: chown_uploads
  55. chown_uploads=YES
  56. chown_username=ftp
  57.  
  58. client> ./ftp server
  59. Connected to server.
  60. 220 (vsFTPd 2.0.5)
  61. Name (server:root): ftp
  62. 331 Please specify the password.
  63. Password:
  64. 500 OOPS: cannot change directory:/var/ftp/pub/incoming
  65. Login failed.
  66. ftp> bye
  67.  
  68. listen=YES
  69. anonymous_enable=YES
  70. write_enable=YES
  71. anon_upload_enable=YES
  72. anon_mkdir_write_enable=YES
  73.  
  74. # mkdir /var/ftp/pub/upload
  75.  
  76. anon_root=/var/ftp/pub/incoming
  77.  
  78. ftp:x:119:131:ftp daemon,,,:/var/ftp/pub/:/bin/false
  79.  
  80. allow_writeable_chroot=YES
Add Comment
Please, Sign In to add comment