Visit The New, Modern Unix Linux Community


New user to own files made by root?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers New user to own files made by root?
# 1  
New user to own files made by root?

Hi,
when I installed debian 8, all files are created and owned by root, when I add new user, for example marco, he can't create directory or change files created by root. I tried with ftp, permission denied.

so, I am interested how to grant to user marco ownership of all files in the system so he can make directories, files, change existing files (owned by root), etc?

I tried to add marco in /etc/sudoers ALL=(ALL:ALL) ALL the same as root, but it didn't help. I added also user marco to the root group but again the same situation.

I must use another user, because proftpd refuses root, they/developers got idea that all people will have sever with 100 users and I just want one ftp user (root), but proftpd refuses root user. now I must use marco or proftpd user and grant to that user ownership of all files in the system.
# 2  
ALL files in the system? I doubt that. You should have an ftp working directory, or a few of those, or maybe a user's home directory, to send and receive files. These can be chowned or chmoded. The rest should be left alone.
# 3  
I have NEVER seen one true unix system where a user owned all files, there are very good reasons why, and if we showed you how to give marco the ownership of alll, the next post you will be sending is how to get on your box that isnt working propely anymore... and all that can be done is a complete reinstall.. Is that what you want?

In other terms, users have right given by root, at some places only... That is what you have to decide: Where should marco have right to do what he want other than his home directory... It cannot be in a system file-system so forget about /bin etc....

Usually users have dedicated filsystems for their soft and data e.g. oracle

Last edited by vbe; 10-08-2015 at 01:08 PM..
# 4  
Okay, thank you for informationm, then marco should be able to do what he wants in /var/www and it subfolders (html in debian, it is like public_html), but /var/www/html is onwed by www-data/apache.
should I then assign user apache to proftpd or I should somehow assign www folder to marco? but then in first case, I should make password for user apache and I don't think it is good. any advice?
# 5  
What group is /var/www assigned to? Make marco belong to that group as well.

---------- Post updated at 19:28 ---------- Previous update was at 19:25 ----------

And, of course, chmod /var/www accordingly.
# 6  
Quote:
Originally Posted by RudiC
What group is /var/www assigned to? Make marco belong to that group as well.
And, of course, chmod /var/www accordingly.
Hi, thank you for answer,
/var/www/html folder belongs to the user "apache/www-data" and to the group "root".
therefore, I assigned user proftpd (marco, whatever) to the group root and after that I tried to create folder and files, I could do it only in html folder, not outside of it. that's what I wanted.
to change files everywhere, i can use sftp instead of ftp, sftp let me to login as root and change and create files anywhere in the system. I tried it now with winscp and filezilla and it works. when I login as proftpd I can change files only in /var/www/html

for people who need the same solution, use next commands, just change proftpd with your parameters, marco, proftpd, anything, adapt it to your case:
Code:
# if you want to list all groups in your system:
cut -d: -f1 /etc/group
ls -ld html #to check information about folder html
usermod -a -G root proftpd # to assign user proftpd to the group root
# you can check it then with command:
id proftpd # in my case the result:
uid=109(proftpd) gid=0(root) groups=0(root)
id -Gn proftpd #another method to check which group belong user proftpd, in my case result was:
root
chmod -R g+w html #to allow proftpd from the group to create new directories and files inside of folder html.

this topic can be marked as solved.
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #312
Difficulty: Easy
Linus Torvalds created Unix and Git.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

[Tip] Housekeeping Tasks Made Easy - User Home directories and Leftover Files

We have regularly questions about how to create users and user accounts. But regularly user accounts need to be deleted too. It is quite easy to delete the user account itself but usually the HOME directory of the user remains. It is good style to remove these directories but simply deleting... (3 Replies)
Discussion started by: bakunin
3 Replies

2. Shell Programming and Scripting

How to give root access to non root user?

Currently in my system Red Hat is installed. And Many user connect to my machine via SSH Techia Terminal. I want to give some users a root level access. Can anyone please help me how to make it possible. I too searched on the Google but didn't find the correct way Regards ADI (4 Replies)
Discussion started by: adisky123
4 Replies

3. UNIX for Advanced & Expert Users

Root and non-root user not able to delete the file

Hi!! one strange problem occurred with my RHEL 5 box. i'm having logs folder with ownership of non-root user. Created some files with root user under logs folder. here is the scene: -rw-r----- 1 root root 1048227 Feb 28 12:34 SystemOut_13.02.28_12.34.10.log -rw-r----- 1 root root ... (6 Replies)
Discussion started by: sukhdip
6 Replies

4. UNIX for Dummies Questions & Answers

Sudo to delegate permission from non-root user to another non-root user

I've been through many threads before i decide to create a separate thread. I can't really find the solution to my (simple) problem. Here's what I'm trying to achieve: As "canar" user I want to run a command, let's say "/opt/ocaml/bin/ocaml" as "duck" user. The only to achieve this is to... (1 Reply)
Discussion started by: canar
1 Replies

5. AIX

find command to list all the 777 files and directories owned by root user

Hi I'm logged in to an AIX box now and we need to do an audit on this box. cbssapr01:# pwd / Which command will show all the files and directories owned by root user with permissions as 777 ? (8 Replies)
Discussion started by: newtoaixos
8 Replies

6. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

7. UNIX for Advanced & Expert Users

How to : Identify changes made with root ?

Thanks Avklinux (1 Reply)
Discussion started by: avklinux
1 Replies

8. UNIX for Dummies Questions & Answers

monitor changes made by root

Is there any way in Solaris 9 to monitor changes made to user accounts by root? (0 Replies)
Discussion started by: scriptarg
0 Replies

9. UNIX for Advanced & Expert Users

Other than root user .Normal user is unable to create files

Hi all, I am using Sun Solaris 9 .In this system normal users unable to create files from the command line.I added these users in bin,adm and even root group i found them unable to create a file. (1 Reply)
Discussion started by: mallesh
1 Replies

10. Shell Programming and Scripting

Deleting root files from another user

I want to delete some files and directories owned by root from another different user in HP-UX 10.20. The list of files looks like: (user test) bash-2.03$ ls -alrt total 20 ... (2 Replies)
Discussion started by: choo
2 Replies

Featured Tech Videos