LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How can i make user always create files + folders with 775 permission ? Please help (https://www.linuxquestions.org/questions/linux-software-2/how-can-i-make-user-always-create-files-folders-with-775-permission-please-help-4175594846/)

ParanoiaUser 12-05-2016 01:40 PM

How can i make user always create files + folders with 775 permission ? Please help
 
Hello,

I am trying to achieve the following on Debian, i need to have testuser create all his files + folders with 775 permission, everything this user creates i would like for it to have that permission.

I would be VERY appreciative if someone could tell me how to do this.

---
What will also work would be some way i could set a folder to always have that permission no matter what is written in it and by who.

lazydog 12-05-2016 01:56 PM

Have a look at umask.

ParanoiaUser 12-05-2016 02:27 PM

Quote:

Originally Posted by lazydog (Post 5638313)
Have a look at umask.


Reading about it but still no luck so far.

c0wb0y 12-05-2016 03:25 PM

Read some more?

szboardstretcher 12-05-2016 03:28 PM

in the users .bash_profile or .bashrc file add the line:

Code:

umask 0002
You can just type 'umask' on the command line to see the current umask.

ParanoiaUser 12-05-2016 04:28 PM

Thank you for your replies.

I have

umask 0002

If i create a new file via SFTP, it gets permission 0644 rw-r--r-- , i also need write for the group so it didnt do the trick :(.

John VV 12-05-2016 04:37 PM

Quote:

If i create a new file via SFTP,
now that ads a twist
this is a REMOTE login

that should have been posted in the very first post and NOT just finding this out in post #6

what software are you using and what is the host?

and you REALLY DO NOT !!!!! want remote users using 775

Habitual 12-05-2016 05:09 PM

Quote:

Originally Posted by ParanoiaUser (Post 5638376)
Thank you for your replies.

I have

umask 0002

If i create a new file via SFTP, it gets permission 0644 rw-r--r-- , i also need write for the group so it didnt do the trick :(.

This activity have any thing to do with apache?

ParanoiaUser 12-06-2016 04:41 AM

Quote:

Originally Posted by Habitual (Post 5638392)
This activity have any thing to do with apache?

Nope.

--

So, i have 2 users, we'll call them user1 and user2.

User1 will have access to SFTP + SSH, user2 will have access only to FTP.

If user1 creates a file, user2 will not have write permission for that file when connected to FTP.

I need to give user2 write access to the file, how can i do this?

BW-userx 12-06-2016 07:48 AM

Quote:

Originally Posted by ParanoiaUser (Post 5638302)
Hello,

I am trying to achieve the following on Debian, i need to have testuser create all his files + folders with 775 permission, everything this user creates i would like for it to have that permission.

I would be VERY appreciative if someone could tell me how to do this.

---
What will also work would be some way i could set a folder to always have that permission no matter what is written in it and by who.

What is Umask and How To Setup Default umask Under Linux?

ParanoiaUser 12-06-2016 10:48 AM

Quote:

Originally Posted by BW-userx (Post 5638606)



Quote:

Originally Posted by ParanoiaUser (Post 5638376)
Thank you for your replies.

I have

umask 0002

If i create a new file via SFTP, it gets permission 0644 rw-r--r-- , i also need write for the group so it didnt do the trick :(.

I've already tried to set that up :(.

BW-userx 12-06-2016 11:03 AM

Quote:

Originally Posted by ParanoiaUser (Post 5638686)
I've already tried to set that up :(.

you might have thought of this or tried it already, but have you tried using groups with them permissions/limits attached to it, then who ever is assigned to that group can, and them not attached to that group cannot?

Guttorm 12-06-2016 11:21 AM

Hello

Maybe this has to do with SFTP? If the idea is that they can transfer files but not run scripts, I think you need to put the umask in the sshd config.

http://riaschissl.bestsolution.at/20...mask-for-sftp/

ParanoiaUser 12-06-2016 11:46 AM

Quote:

Originally Posted by BW-userx (Post 5638692)
you might have thought of this or tried it already, but have you tried using groups with them permissions/limits attached to it, then who ever is assigned to that group can, and them not attached to that group cannot?

I have added them like this in etc/group

user1:x:1000:user2
user2:x:1001:user1

Should i change something ? hmm.

Maybe they are not added correctly ?

BW-userx 12-06-2016 11:56 AM

Quote:

Originally Posted by Guttorm (Post 5638699)
Hello

Maybe this has to do with SFTP? If the idea is that they can transfer files but not run scripts, I think you need to put the umask in the sshd config.

http://riaschissl.bestsolution.at/20...mask-for-sftp/

can execute just not write to is the only thing that the OP seems to be worried about.


Quote:

0775
user group other
setuid is unset can read can read can read
setgid is unset can write can write cannot write
Sticky bit is unset can execute can execute can execute
and that only pertains to other that the write permissions have been removed from.

ParanoiaUser 12-06-2016 12:00 PM

Actually i want both users to be able to write, just have no idea how to do it so they can overwrite their files.

if user1 creates a file, user2 will not be able to overwrite it.

BW-userx 12-06-2016 12:02 PM

Quote:

Originally Posted by ParanoiaUser (Post 5638567)
Nope.

--

So, i have 2 users, we'll call them user1 and user2.

User1 will have access to SFTP + SSH, user2 will have access only to FTP.

If user1 creates a file, user2 will not have write permission for that file when connected to FTP.

I need to give user2 write access to the file, how can i do this?

if a user writes a file. how is your directory structure made up? is this a controlled directory structure? As it should be so one cannot log in and go anywhere in that system.

then the permissions need to be set to the directory where a(one) user is the owner and all others (users) can only read, and execute, just not write per 775 permissions granting.

therefore others cannot write anything within that directory other then the owner.
  1. Use chmod -R 755 /opt/lampp/htdocs if you want to change permissions of all files and directories at once.
  2. Use find /opt/lampp/htdocs -type d -exec chmod 755 {} \; if the number of files you are using is very large. ...
  3. Use chmod 755 $(find /path/to/base/dir -type d) otherwise. Better to use the first one in any situation.

http://linuxcommand.org/lts0070.php

szboardstretcher 12-06-2016 12:09 PM

Quote:

Originally Posted by ParanoiaUser (Post 5638717)
Actually i want both users to be able to write, just have no idea how to do it so they can overwrite their files.

if user1 creates a file, user2 will not be able to overwrite it.

Put them in the same group, and give the group 'rw' permissions.

ParanoiaUser 12-06-2016 12:12 PM

If user1 creates a file, user2 will not have write rights to that file, i dont want this, i want him to have write rights.

I basically want the 2 users to have identical rights as far as file permissions go, i want them to be able to write, execute and read each other's files.

EDIT: I want this permission to maintain for newly created files, folders and subfolders.

ParanoiaUser 12-06-2016 12:13 PM

Quote:

Originally Posted by szboardstretcher (Post 5638728)
Put them in the same group, and give the group 'rw' permissions.

Could you detail this ? what do i have to modify here exactly ?

user1:x:1000:user2
user2:x:1001:user1

szboardstretcher 12-06-2016 12:20 PM

Here is a small sample of the guides available that explain how to manage users and groups. Have a look.

https://access.redhat.com/documentat...nd_Groups.html
https://wiki.archlinux.org/index.php/Users_and_groups
http://www.howtogeek.com/howto/36845...oups-in-linux/
https://www.cyberciti.biz/faq/howto-...user-to-group/
https://www.linode.com/docs/tools-re...ers-and-groups
http://www.tecmint.com/manage-users-...oups-in-linux/
http://www.yolinux.com/TUTORIALS/Lin...ingGroups.html
https://www.centos.org/docs/5/html/D...ers-tools.html
http://www.linux-mag.com/id/7759/
https://www.digitalocean.com/communi...ux-permissions
http://www.tldp.org/LDP/sag/html/managing-users.html
http://www.techrepublic.com/article/...tion-in-linux/
http://www.intechgrity.com/user-and-...ced-concepts/#

John VV 12-06-2016 12:23 PM

well user "1000" is ROOT
root can do EVERYTHING

and user 2 SHOULD NEVER be able to do everything root dose

ParanoiaUser 12-06-2016 12:25 PM

Quote:

Originally Posted by John VV (Post 5638741)
well user "1000" is ROOT
root can do EVERYTHING

and user 2 SHOULD NEVER be able to do everything root dose

User "1000" is not root, it's just a user on the machine.

ParanoiaUser 12-06-2016 12:31 PM

Quote:

Originally Posted by szboardstretcher (Post 5638739)

I appreciate you linking me that, but instead of wasting time copy pasting me stuff and making me read thru tons of stuff you could of just told me what to modify here:

user1:x:1000:user2
user2:x:1001:user1

Or simple steps to what exactly i can do to achieve what i am looking at achieving.

BW-userx 12-06-2016 12:33 PM

Quote:

Originally Posted by ParanoiaUser (Post 5638717)
Actually i want both users to be able to write, just have no idea how to do it so they can overwrite their files.

if user1 creates a file, user2 will not be able to overwrite it.

OK this is what I did.

here I have a external HDD hooked up via USB under me, my user name. I created a different user bob.

Off the terminal I cd to the external hdd, created a directory under my user name, userx, changed permissions to it to be 777, chmod 777 $(find /run/media/userx/WD3TB/testwrite -type d)


then created a file, the add text to it. I logged as bob, bob can read the file, but bob cannot add text to it.



then I did the same with bob, logged in as bob, he created a file, wrote to it. Userx can see it, read it but cannot write to it. do to the creators permissions set to the file at creation time.

Code:

userx@voided1.what/run/media/userx/WD3TB/testwrite>> chmod 777 $(find /run/media/userx/WD3TB/testwrite -type d)

userx@voided1.what/run/media/userx/WD3TB/testwrite>> su bob
Password:
[bob@voided1 testwrite]$ ls
testpermissions
[bob@voided1 testwrite]$ cat testpermissions
tesing
[bob@voided1 testwrite]$ echo "more from bob" >> testpermissions
bash: testpermissions: Permission denied

[bob@voided1 testwrite]$ touch bobtestfile
[bob@voided1 testwrite]$ echo "ho usex try me" > bobtestfile
[bob@voided1 testwrite]$ cat bobtestfile
ho usex try me
[bob@voided1 testwrite]$ exit
exit


userx@voided1.what/run/media/userx/WD3TB/testwrite>> ls
bobtestfile  testpermissions
userx@voided1.what/run/media/userx/WD3TB/testwrite>> cat bobtestfile
ho usex try me
userx@voided1.what/run/media/userx/WD3TB/testwrite>> echo "added by userx" >> bobtestfile
bash: bobtestfile: Permission denied

this way with ftp when someone logs in they should be sent to that directory, per the ftp config file, then anyone that you allow to log in can look at everyone's files, create their own file, and write to it, and read others files but not write to anyone elses files.

ParanoiaUser 12-06-2016 12:37 PM

Quote:

Originally Posted by BW-userx (Post 5638753)
OK this is what I did.

here I have a external HDD vis USB under me, my user name. I created a different user bob. Off the terminal I cd to the external hdd, created a directory under my user name, userx, then created a file, the add text to it. I logged as bob, read the file, but bob cannot add text to it.




I gave the Directory permissions 777. created another user called bob.

I cd into an external HDD hooked up USB. created a file under my user name, userx, then added text to it. Bob can see it, and read it but cannot write to it.

then I did the same with bob, he created a file, wrote to it. Userx can see it, read it but cannot write to it. do to the creators permissions set to the file at creaton time.

Code:

userx@voided1.what/run/media/userx/WD3TB/testwrite>> chmod 777 $(find /run/media/userx/WD3TB/testwrite -type d)
userx@voided1.what/run/media/userx/WD3TB/testwrite>> su bob
Password:
[bob@voided1 testwrite]$ ls
testpermissions
[bob@voided1 testwrite]$ cat testpermissions
tesing
[bob@voided1 testwrite]$ echo "more from bob" >> testpermissions
bash: testpermissions: Permission denied
[bob@voided1 testwrite]$ touch bobtestfile
[bob@voided1 testwrite]$ echo "ho usex try me" > bobtestfile
[bob@voided1 testwrite]$ cat bobtestfile
ho usex try me
[bob@voided1 testwrite]$ exit
exit
userx@voided1.what/run/media/userx/WD3TB/testwrite>> ls
bobtestfile  testpermissions
userx@voided1.what/run/media/userx/WD3TB/testwrite>> cat bobtestfile
ho usex try me
userx@voided1.what/run/media/userx/WD3TB/testwrite>> echo "added by userx" >> bobtestfile
bash: bobtestfile: Permission denied
userx@voided1.what/run/media/userx/WD3TB/testwrite>>


I want both users to have access to write files (for future files and folders created also), not only one of them.

szboardstretcher 12-06-2016 12:42 PM

Quote:

Originally Posted by ParanoiaUser (Post 5638750)
I appreciate you linking me that, but instead of wasting time copy pasting me stuff and making me read thru tons of stuff you could of just told me what to modify here:

user1:x:1000:user2
user2:x:1001:user1

Or simple steps to what exactly i can do to achieve what i am looking at achieving.

I look at it like this. You came here asking about users and permissions and have been on this thread for about 24 hours now, when you could have spent 15 minutes reading about users and permissions in any of those guides and did it yourself 23 hours ago.

ParanoiaUser 12-06-2016 12:46 PM

Quote:

Originally Posted by szboardstretcher (Post 5638759)
I look at it like this. You came here asking about users and permissions and have been on this thread for about 24 hours now, when you could have spent 15 minutes reading about users and permissions in any of those guides and did it yourself 23 hours ago.

I look at it like this, youre wasting both our time not providing a solution to what i am looking for.

Have a clear answer or not ? I am not here to learn linux, i am here to fix a specific issue.

I've read about groups in the past also...and also now, i am stupid and i can't do what i want to, enlighten me with a clear solution please.

I see this as me asking how much does 4+4 equal and being handed a math book to learn math.

Edit: Even if i may sound rude, i am not trying to be, i'm just looking for clear answers, i don't want to waste time (and the 2 user's time) experimenting with all kinds of stuff to see if it works and also possibly breaking who knows what in the process.

BW-userx 12-06-2016 12:54 PM

Quote:

Originally Posted by ParanoiaUser (Post 5638755)
I want both users to have access to write files (for future files and folders created also), not only one of them.

you really need to read up and test out permissions and what they allow one and many user to do when certain permissions are set on files, and directories instead of making us do all of your work for you.

Just because you're not wanting to learn how to use Linux, well guess what if you are not using Windows and have to deal with Windows you still have to learn how to use it.

what does permissions 777, 775, 755 do ? if you set them on a directory, and if you set them on a file? what differences does one get between the two ?

not to mention permissions 666

szboardstretcher 12-06-2016 01:04 PM

The commands, mentioned in the first paragraph of nearly any of my links:

Code:

groupadd, usermod, groupmod
Hopefully you can make use of those commands. Good luck. The reason you aren't getting a specific command is that I'm not sure I understand exactly what you need in your specific environment. If you look at and understand the commands you will be able to use them to do what you need though. Share what you try and your results and you will get more help.

/my-involvement

John VV 12-06-2016 01:25 PM

depending on the OS
500 is root
or
1000 is root

szboardstretcher 12-06-2016 01:37 PM

Quote:

Originally Posted by John VV (Post 5638792)
depending on the OS
500 is root
or
1000 is root

FWIW: 'root' is uid 0 on all Linux/Unix variants that I know of.

ParanoiaUser 12-06-2016 02:02 PM

Guys, let me explain in more detail.

I have user1 with SFTP+SSH access to a machine.
User1 runs processes and creates files in home/user1/foldername

User2 has FTP only access, no sftp or ssh and is chrooted to home/user1/foldername

Having:

user1:x:1000:user2
user2:x:1001:user1

set in etc/group.

When user1 creates a file in home/user1/foldername, user2 will not be able to modify that file.

I need both user1 & user2 to have read,write&execute(if execute is needed to delete a file) permissions on all files located in home/user1/foldername !BUT! also future files & folders + subfolders that will get created there, for example: home/user1/foldername/newfolder/newfile.txt

szboardstretcher 12-06-2016 02:07 PM

  • what FTP server are you using?
  • what configuration have you for it?
  • what does your chroot configuration for this user look like?
  • what does /etc/passwd and /etc/group look like on the user1 and user2 lines?

c0wb0y 12-06-2016 02:12 PM

I see what you mean. And it appears you don't have much grasp of the ownership/permission fundamentals which is alright at the beginning. If you want to become more efficient, you need to understand the concept of it.

You have few issues there:
-
Quote:

I have user1 with SFTP+SSH access to a machine.
Whenever you grant SSH access to a user, it is pointless to setup an SFTP which a lot of users even demand a chrooted setup without realizing that the user has shell access anyway. SCP will do just fine.

- You have haphazardly granted group membership to each other without considering its implication. If you really want a shared resource, why not allocate a separate location with a common group membership?
- It is advisable to create a shared folder outside one's $HOME.

Why don't you start from simple setup and work your way up from there? We're you able to even get past the SFTP setup?

ParanoiaUser 12-06-2016 02:42 PM

VSFTPD
Code:

# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
#
# Run standalone?  vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=YES
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
listen_ipv6=NO
#
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=002
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# If enabled, vsftpd will display directory listings with the time
# in  your  local  time  zone.  The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
use_localtime=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may restrict local users to their home directories.  See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
chroot_local_user=YES
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
#chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# Customization
#
# Some of vsftpd's settings don't fit the filesystem layout by
# default.
#
# This option should be the name of a directory which is empty.  Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd/empty
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=vsftpd
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
allow_writeable_chroot=YES
listen_port=30050
pasv_enable=Yes
pasv_max_port=10100
pasv_min_port=10090
chmod_enable=YES
seccomp_sandbox=NO


etc/passwd
Code:

user1:x:1000:1000:,,,:/home/user1:/bin/bash
user2:x:1001:1001:,,,:/home/user1/randomfolder:/bin/bash

etc/group
Code:

user1:x:1000:user2
user2:x:1001:user1


c0wb0y 12-06-2016 02:48 PM

Quote:

etc/passwd
user1:x:1000:1000:,,,:/home/user1:/bin/bash
user2:x:1001:1001:,,,:/home/user1/randomfolder:/bin/bash
Quote:

etc/group
user1:x:1000:user2
user2:x:1001:user1
This is exactly what I was talking about on my previous post.

ParanoiaUser 12-06-2016 02:54 PM

Quote:

Originally Posted by c0wb0y (Post 5638825)
This is exactly what I was talking about on my previous post.

Your posts are of no use so far man, you've told me to read more and asked me how i managed to setup SFTP.

Give me clear answers on what i need to modify to resolve my issue if you want to help me and i'll be appreciative, if not, please dont reply.

c0wb0y 12-06-2016 03:00 PM

Well, I'm just trying to point out where you can improve your setup. If that is not appreciated, that's all good. Good luck.

ParanoiaUser 12-06-2016 03:04 PM

Yep, of no use.

You dont tell me how to improve it = useless to me, i don't need someone telling me "you can go learn to do this" i need someone to tell me exactly what i need to do to solve this specific problem i've posted about, i don't want to go read hundreds of text lines, if i wanted to do that i wouldnt be here asking for your help.

I believe my problem is Very basic & simple to solve, i am not trying to become a network administrator for NASA you know ? i am asking simple questions here.

BW-userx 12-06-2016 03:39 PM

Quote:

Originally Posted by ParanoiaUser (Post 5638833)
I believe my problem is Very basic & simple to solve, i am not trying to become a network administrator for NASA you know ? i am asking simple questions here.

No you are not, you are trying to become a network administrator of a ftp sight.


if it is so simple then why are you asking us how to fix it. You NOT wanting to learn how to set up your own system and its software is not very productive on your part.

Like I and another has suggested to set up a directory pool share type setting then set permissions to that parent directory so everybody can play inside of it without destroying others toys.

allowing others to log into someone else home is not a good idea.


https://ubuntuforums.org/showthread....55#post3138955

Habitual 12-06-2016 03:43 PM

Quote:

Originally Posted by ParanoiaUser (Post 5638833)
Yep, of no use.

You dont tell me how to improve it = useless to me, i don't need someone telling me "you can go learn to do this" i need someone to tell me exactly what i need to do to solve this specific problem i've posted about, i don't want to go read hundreds of text lines, if i wanted to do that i wouldnt be here asking for your help.

I believe my problem is Very basic & simple to solve, i am not trying to become a network administrator for NASA you know ? i am asking simple questions here.

If you don't know jack all about this, then how can you decide "no use"?
Show some gratitude and not attitude.

ParanoiaUser 12-06-2016 03:50 PM

10$ BTC to who helps me solve this first with exact steps.

I don't have time for useless replies and other bullshit lectures, tell me what i want to know faster and in a way my stupid brain can understand it.

szboardstretcher 12-06-2016 04:03 PM

You skipped a question, "what does your chroot configuration for this user look like?"

Not super familiar with Debians config location. You might have to look it up. In centos its directory is /etc/schroot/

BW-userx 12-06-2016 04:06 PM

I think you need to read everything again then rethink your attack on this issue you are having. What apps are you going to use, ssh / SFTP / vsftp -if one user has both and another user has only ftp, then screw that other guy with his ssh, and make him only use ftp so the two users can relate properly using the ftp set up. less head ache.

then just set up your ftp sight accordingly.

with a area they both can play in and not have to worry about the other destroying his toys, and visa a versa. Nor being able to do something in someone esles home directory. only a root admin and the user is suppose to be able to get into it.

BW-userx 12-06-2016 04:12 PM

http://unix.stackexchange.com/questi...ww-with-vsftpd


VSFTP chroot or jail users – limit users to only their home directory howto



Allowing FTP Access to Files Outside the Home Directory Chroot


yep, you're going to have to use your brain to figure out some of this stuff.

calling yourself stupid and telling yourself you can't do this or that is bad, stop bad.

ParanoiaUser 12-06-2016 04:13 PM

Can you guys stop worrying about stuff thats not related to what i am asking ?

I WANT this user to be in the other's home, there are only 2 users on this machine, just answer my question with clear modifications i need to make and stop worrying about things i am not asking about.

"what does your chroot configuration for this user look like?"

user2:x:1001:1001:,,,:/home/user1/randomfolder:/bin/bash

user2 has SSH deny.

Quote:

Originally Posted by BW-userx (Post 5638859)
http://unix.stackexchange.com/questi...ww-with-vsftpd


VSFTP chroot or jail users – limit users to only their home directory howto



Allowing FTP Access to Files Outside the Home Directory Chroot


yep, you're going to have to use your brain to figure out some of this stuff.

calling yourself stupid and telling yourself you can't do this or that is bad, stop bad.

I've already done that man....i dont need to chroot the user, its done, i dont need access outside of the user's home directory....i am not asking for this.

See:

Quote:

Originally Posted by ParanoiaUser (Post 5638806)
Guys, let me explain in more detail.

I have user1 with SFTP+SSH access to a machine.
User1 runs processes and creates files in home/user1/foldername

User2 has FTP only access, no sftp or ssh and is chrooted to home/user1/foldername

Having:

user1:x:1000:user2
user2:x:1001:user1

set in etc/group.

When user1 creates a file in home/user1/foldername, user2 will not be able to modify that file.

Note that: home/user1/foldername is user2's home.

I need both user1 & user2 to have read,write&execute(if execute is needed to delete a file) permissions on all files located in home/user1/foldername !BUT! also future files & folders + subfolders that will get created there, for example: home/user1/foldername/newfolder/newfile.txt


BW-userx 12-06-2016 04:37 PM

Quote:

Originally Posted by ParanoiaUser (Post 5638861)
Can you guys stop worrying about stuff thats not related to what i am asking ?

I WANT this user to be in the other's home, there are only 2 users on this machine, just answer my question with clear modifications i need to make and stop worrying about things i am not asking about.

"what does your chroot configuration for this user look like?"

user2:x:1001:1001:,,,:/home/user1/randomfolder:/bin/bash

user2 has SSH deny.



I've already done that man....i dont need to chroot the user, its done, i dont need access outside of the user's home directory....i am not asking for this.

See:

did you even look at what I did? gave a dir a certain permission where they both could create, read, write but only write to there own files.

ParanoiaUser 12-06-2016 04:39 PM

Quote:

Originally Posted by BW-userx (Post 5638878)
did you even look at what I did? gave a dir a certain permission where they both could create, read, write but only write to there own files.

I want them to write to each other's files, i want them to have identical permissions, if user1 creates a file user2 should be able to do whatever he wants with it, read, write, delete, whatever.

BW-userx 12-06-2016 04:43 PM

Code:



 cd testpermissions
userx@voided1.what/run/media/userx/WD3TB/testpermissions>> ls
userx@voided1.what/run/media/userx/WD3TB/testpermissions>> touch userxfile
userx@voided1.what/run/media/userx/WD3TB/testpermissions>> echo "userx file" > userxfile
userx@voided1.what/run/media/userx/WD3TB/testpermissions>> ls
userxfile
userx@voided1.what/run/media/userx/WD3TB/testpermissions>> echo "userx added this to bobs file" >> bobsfile
bash: bobsfile: Permission denied


userx@voided1.what/run/media/userx/WD3TB/testpermissions>> su bob
Password:
[bob@voided1 testpermissions]$ touch bobsfile
[bob@voided1 testpermissions]$ ls
bobsfile  userxfile
[bob@voided1 testpermissions]$ echo "this is bob" > bobsfile
[bob@voided1 testpermissions]$ ls
bobsfile  userxfile
[bob@voided1 testpermissions]$ cat bobsfile
this is bob
[bob@voided1 testpermissions]$ rm *
rm: remove write-protected regular file 'userxfile'? y
[bob@voided1 testpermissions]$ ls
[bob@voided1 testpermissions]$

files are now all gone


All times are GMT -5. The time now is 06:09 AM.