File Owner Number Rather Than Name

Ubuntu 14.10

Some files have owner as number

Why is it that some files or directories have the owner as a number rather than a name?

My ls -la listing for /var/www/html/ | grep moodle gives

drwxr-xr-x 45 1005 1005 4096 Jan 12 13.53 moodle

Who or what is 1005?

There is no such owner in /etc/passwd

How can linux store meaningful permissions information for a user or group that does not seem to exist?

Thank you


Similar Content



Chgrp Not Changing A File?

Hello,

OS: CentOS 6.3

Background:
I'm trying to set up a situation where my FTP account is in a group where my phpbb forums were created. This will allow me to upload changes as I customize my forums (ie: .css files). However, right now, my problem is that I'm running into invalid permissions and the only way to move the files is to upload the file to a directory my FTP account has access too and then sudo cp the file over. Upon closer inspection of my files, it appears the groups the files have been made under are not the correct group.

Problem:
I am trying to use chgrp on a specific file to change the group owner to the group my FTP account is a member of but it does not seem to be working. Here is a snippet of what I'm doing:

Code:
zzz@aaaa:/var/www/html/yyy/forums/styles/GlossyBlack/theme]$ sudo chgrp apache colours.css -v
group of `colours.css' retained as apache
zzz@aaaa:/var/www/html/yyy/forums/styles/GlossyBlack/theme]$ ls
total 164
drwxr-xr-x 3 5645316 apache  4096 Mar 27 15:11 .
drwxr-xr-x 6 5645316 apache  4096 Nov 18  2012 ..
-rw-r--r-- 1  root     apache 23480 Mar 27 19:05 colours.css

I'm not sure why it still says root so I suspect I am doing something incorrect. When looking around, at first it seemed chgrp could change group owner on files but as I dug more, it seemed it can also change groups themselves. So I'm a little confused and require some clarity of experts.

I hope changing the group owner of this file will give access to my FTP account so I can apply this change to all needed locations.

Thanks.

Problem With Chgrp In Bash

Code:
alice@alice:~$ grep 1003 /etc/group
alice:x:1003:
alice@alice:~$ grep 1003 /etc/passwd
alice:x:1003:1003:Alice,,,:/home/alice:/bin/bash

So there's nobody in alice's group except alice (for whatever that's worth)

Code:
alice@alice:~$ ls -ld dollstuff
drwxrwxr-x 2 alice alice 4096 Jan 28 10:55 dollstuff

alice clearly owns and has full access to the directory "dollstuff" which resides in her home directory

Code:
alice@alice:~$ grep 1005 /etc/group
common:x:1005:alice,dilbert,wally

there's another group of which alice is a member, and alice wants to share her directory with the other members of the group

Code:
alice@alice:~$ chgrp common dollstuff
chgrp: changing group of ‘dollstuff’: Operation not permitted

Why not? dilbert and wally do this very same thing on their machines on a regular basis. All are running fully updated Ubuntu 14.04.

"chown ladybug:common dollstuff" is also disallowed, although "rm -r dollstuff" does work.

Assign Group Permission To Newly Created Files

Directory /media/data/torrents/ has permissions 775, user yzt, group transmission

yzt and debian-transmission are members of the group transmission.

transmission-daemon is run by debian-transmission, and the new files it downloads have permissions 644, owner debian-transmission, group transmission. This is a problem, because I can't later move the files as my user, yzt, and need to be switching to root to change the permissions/ownership to be able to do so.

Using sticky bit I could copy it to anywhere else, but I'm interested on actually moving the file, not just copying it. I could run transmission-daemon as yzt and problem solved, but I rather have that internet facing service running by a limited user, just in case some vulnerability is found on Transmission.

So my question is, how can I set that every new file created under /media/data/torrents/ has permissions 775 like its parent directory?

Setfacl Help

I can't believe I wrote a looong message and it logged me out when I tried to submit it.

So anyway, in short lines:

- I have a network of sites where all sites share same "images" folder
- I have created /home/_images/entities and symlinked it from all websites
- It works great with Apache, when I open /images/ on any of the sites I get list of images and can view them

The problem is suPHP which changes process ID of the PHP script to the file owner ID, so when I load site1.com, all scripts are executed as user1 (and files/folders created with those scripts belong to user1:user1). When I load site2.com, all scripts are executed as user2 (and files/folders created with those scripts belong to user2:user2). All these users do NOT belong to the same group, and I wouldn't like to change that as it is cPanel/WHM server so I'm afraid I'll screw something up if I change (primary?) group of all users.

Therefore I need to set it up in such way that all newly created folders and files under /home/_images/entities (owned by root) have read/write permissions for everyone.

Here's the command I used:

Code:
setfacl -Rdm o::rwx /home/_images/entities

To check it:
Code:
root@server1 [~]# getfacl /home/_images/entities/
getfacl: Removing leading '/' from absolute path names
# file: home/_images/entities/
# owner: root
# group: root
user::rwx
group::rwx
other::rwx
default:user::rwx
default:group::rwx
default:other::rwx

This looks fine, however when I try upload an image via site1.com it looks like this:

Code:
root@server1 [/home/_images/entities]# ls -l
total 24
drwxrwxrwx+ 5 root    root    4096 Jan 14 06:25 ./
drwxrwxrwx  5 root    root    4096 Jan 12 13:08 ../
drwxrwxr-x+ 3 user1   user1   4096 Jan 14 06:25 1/

And in folder "1" is the image (and thumbs folder):

Code:
root@server1 [/home/_images/entities/1]# ls -l
total 236
drwxrwxr-x+ 3 user1   user1     4096 Jan 14 06:25 ./
drwxrwxrwx+ 5 root    root      4096 Jan 14 06:25 ../
-rw-rw-rw-  1 user1   user1   225569 Jan 14 06:25 689048f221ab7c556f4d482a9d92b2d6.jpg
drwxrwxr-x+ 2 user1   user1   4096 Jan 14 06:25 thumbs/

My questions:

1) Why newly created folders do not have "write" permissions for everyone else [not user and/or group]? If I upload first image from site1.com, then I can't upload other images from any other site, while all sites can display them.

2) What is the + at the end of permissions list? (drwxrwxr-x+)

3) Why newly created files have only "rw" permissions for user, group AND everyone else, and not execute permissions? I don't actually need execute flag set here, but from my command you can see I've set "o::rwx" so it should be there (or not?)

Actually the real problem is #1 - other users can't write to this folder so users can't upload images from other sites nor other sites can create (missing) thumbnails.

Using Find And Pipe To Tar

am trying to use tar in combination with find, the goal is to all files in /export that have been modified in the last 24 hours (back up purposes), then tar them so I can untar on the backup server, updating just the modified files.

Perhaps there is a better way, however, I have tried using cpio but the problem come in when I copy to the NAS drive (NTFS) I lose all my owner/group and permissions. I have found that if I tar the files, then copy them to the NAS, when I untar on the server, it will retain the owner/group and permissions.

So… here is what I have tried:

First, I use the find command to see what files should be in the tar archive.
Code:
/export $ find . -depth -mtime 0 -print
./file4
./file3
.

Ok, that looks right, now I will try to pipe that in to tar
Code:
/export $ find . -depth -mtime 0 -print0 | tar -czvf backup.tar.gz --null -T - 
./file4
./file3
./
./share/
./share/pdf/
./share/pdf/penny-2014-09-03-11:41.30.pdf
./share/pdf/penny-2014-09-03-14:25.17.pdf
./share/pdf/penny-2014-09-03-11:24.36.pdf
./share/pdf/penny-2014-09-03-14:37.12.pdf
tar: ./share/pdf/.directory: Cannot open: Permission denied
./share/pdf/penny-2014-09-02-14:52.06.pdf
./share/pdf/penny-2014-09-03-12:18.43.pdf
tar: ./share/PDF: Cannot open: Permission denied
./share/file3
tar: ./share/.directory: Cannot open: Permission denied
./dir1/
./dir1/file1
./file4
./file2
./file3
tar: ./.directory: Cannot open: Permission denied
./list
tar: Exiting with failure status due to previous errors

It seems that it is trying to tar all the files in that directory. When I view the files in backup.tar.gz all of the files from /export are in there not just the modified ones

Why Are Files Copied To A USB Stick Invisible?

I recently crashed my LMDE system, and trying to retrieve something from the disaster, booted up the failsafe OS and copied a number of files onto a USB stick using the 'cp'command.
'ls -alrt /media/dougb' showed that the files were present and correct on the stick.

However when I attached the stick to a working LMDE PC there appeared to be nothing on it, whether I looked at the stick in the desktop file manager or by listing in a terminal.

I've tried changing the permissions and/or ownership of the files (via the broken OS) without success.

Why aren't the files visible? What can I do about it?

Normal Linux User Recursively Write Access To Apache Document Root

I tried adding two users in apache group and given 775 permission to Document root but user is not able to write into files in DocumentRoot

Tried adding user and DocumentRoot Folder in sudo file but not able to do it recursively

please help


Thanks for reply,
I have already given chmod 775 -R DocumentRoot - for recursively writting permission
You have told to add user in www-data group and chmod 775 -R to DocumentRoot
usermod -a -G www-data <user1>

How can users in www-data can able to write in DocumentRoot which has apache:apache owner and group
please clarify...

Done below steps to solve this:
1) I have created a new group webdata and added required users in this group
2) set sticky bit to document root with below command
setfacl -m g:webdata:rwx -R /path/to/documentroot/
this command will set rwx permission to DocumentRoot so that members in webdata can have full access but still DocumentRoot user and group will be apache

Permissions Question

Hello,

Just starting with Linux and I have a question about permissions. When I run ls on /bin/bash I get the following permissions output:

-rwxr-xr-x .......

Why are there 4 letters on the owner's permissions, namely the last "r" which I have put in bold? Since there are only 3 types - r, w and x, what's the point of the second "r" ?

Thanks

A Kernel Thread Shares The Open Files From A User Thread

Hi all,

In my work, I'd like to spawn separate kernel threads (tasks) to execute syscall asynchronously. Specifically, a user thread issues a syscall, goes into kernel, save the syscall number and arguments somewhere in the kernel address space, but does not execute the syscall. A kernel thread which is different from the user thread, will fetch the syscall number and arguments to execute the syscall on behalf of the user thread.
But for file operations such as read, the kernel thread is not aware of the open files of the user threads. For example, if the user thread opens a file and get a file descriptor, then it issue a read() syscall. The kernel thread cannot execute the read() on behalf of the user thread by just using the file descriptor. Thus I need some way to allow the kernel thread share the open files information with the user thread, such that the kernel thread will have the context of the open file to execute read(). I tried to pass the files_struct of the user thread's task_struct to the kernel thread, but it didn't help, read() returns a EFAULT error.
Can anyone give me some suggestions on how to make a kernel thread share the open files with a user thread? Or more straightforward how to execute the read() syscall in the example above in kernel thread? Thank you very much!

--Louis

Setting Up Apache2 Virtual Host - Getting URL Not Found Error

Trying to set up Virtual Host on Ubuntu 14.04.

Any help to solve this is greatly appreciated!!!

Here is info:

Directory: /var/www/mydb.com/public_html (owner set to $USER:$USER)

Permissions: sudo chmod -R 755 /var/www/

Sample Page: /var/www/mydb.com/public_html/index.html (Shows Message)

Virtual Host Files:

Sites Available: mydb.com.conf
set ServerAdmin => admin@mydb.com
set ServerName => mydb.com
set ServerAlias => www.mydb.com
set DocumentRoot => /var/www/mydb.com/public_html

Sites Enabled: mydb.com.conf
ServerName mydb.com
ServerAlias www.mydb.com
ServerAdmin admin@mydb.com
DocumentRoot /var/www/mydb.com/public_html


I: disabled 000-default.conf w/a2dissite
enabled mydb.com.conf w/a2ensite

HOSTS File /etc/hosts:

127.0.1.1 localhost mydb.com
127.0.0.1 localhost
127.0.1.1 rick-Latitude-E6510

Result of localhost/mydb.com Same with www.mydb.com.

404 Not Found.
The requested URL /mydb.com was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80

This from /var/log/apache2/access.log

127.0.0.1 - - [03/Apr/2015:13:19:08 -0700] "GET /mydb.com HTTP/1.1" 404 496 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0"