# [SOLVED] How to pass file to another user

## honp

Hi i solve interesting problem viz. Subj.

I have some users and i need them to be able to pass files to each other. 

eample:

USER1 wants to pass file.txt to USER2, but no one else can see this file. 

Email, can not be used, ftp can not be used, web browser can not be used.

How would you solve it?

If chown would work for users, it would be good choice, but it do not.

thanksLast edited by honp on Fri Sep 02, 2011 12:58 pm; edited 1 time in total

----------

## avx

 *Quote:*   

> USER1 wants to pass file.txt to USER2, but no one else can see this file

 In the sense that no one can see what's inside this file or that no one even notices they are exchanging something?

For a), cryptography maybe combined with steganography.

For b) offline, either in person or by some kind of secret drop place

----------

## honp

Thanks for reply:)

add a) probably can not be used

add b) secret drop place - it sounds good. Any suggestions?

----------

## Akkara

Are the users on the same machine, or is there a shared volume they both can access?

If so, make a new group and put the two users in question in it.

To exchange files, one user places the file in some shared place they both can get to (say, /tmp, if on the same machine), and runs:

```
chgrp the_common_group the_file

chmod 640 the_file
```

This makes the file readable by the group and the user, and nobody else.  The second user, being a member of the same group, can now read the file.Last edited by Akkara on Fri Sep 02, 2011 10:59 am; edited 1 time in total

----------

## John R. Graham

Are all users on the same machine? How many users?

- John

----------

## honp

Let`s say it IS on one computer and it asi about 1000 users.

----------

## MacGyver031

Easiest would be a dropbox with write access but no read access to all other persons. The person who wants to give you the file, is able to write it in the dropbox but no one is able to read it.

Easiest would be if your home folder is accessible, then create a folder 

```
mkdir inbox
```

and make it write exectute only to other users

```
chmod 733 inbox
```

The others can put stuff in to the inbox, but cannot see what is inside.

BR.

----------

## honp

Wow, it is exactly what i wanted and... it is so easy... Thank you very very much.

H.

----------

## Hu

Although only the owner can list the directory that MacGyver031 proposed, any user can open a file in that directory if the user determines the name of the file through other means.  Additionally, since the directory is 0733 (not sticky), any user may remove a file placed by any other user.

----------

## Fitzcarraldo

 *Hu wrote:*   

> Although only the owner can list the directory that MacGyver031 proposed, any user can open a file in that directory if the user determines the name of the file through other means.  Additionally, since the directory is 0733 (not sticky), any user may remove a file placed by any other user.

 

Presumably something like FAM/Gamin (see e.g. File trigger on arrival, not cron - how?) could be used to trigger chmod 700 and chown me:mygoup on any files copied into the directory, though?

----------

## Hu

Only root can use chown on the system in question.  If the file mode was changed without making it owned by the intended recipient, the recipient would lose the ability to open the file.

----------

