R
R
ruboss2016-06-27 20:22:47
linux
ruboss, 2016-06-27 20:22:47

How to open access to user files?

Hey!
There is a www user, he is in the viiw group
and there is a www/html folder, the contents of which are visible to everyone on the Internet

/var/www/html/ (chown www-data.www-data, chmod 0750)

if I upload files via ftp under the www user, then they will be with the www owner and, accordingly, hidden from the web.
How to make it so that automatically when uploading files they become visible on the Internet? Preferably a method without perversions with cron =)
How to do it right? Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2016-06-27
@ruboss

Add umask 002 at the end of the file /home/user_name/.bash_profile You
should get something like this:

# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
umask 002

And one more thing, in the ftp settings, specify umask 002
For sftp in the /etc/ssh/sshd_config config, find the Subsystems parameter and add -u 0002 at the end of it , it should turn out like this:
Subsystem       sftp    /usr/libexec/openssh/sftp-server -u 0002

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question