LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-06-2016, 01:25 PM   #31
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,517

Rep: Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619Reputation: 2619

depending on the OS
500 is root
or
1000 is root
 
Old 12-06-2016, 01:37 PM   #32
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,237

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
Quote:
Originally Posted by John VV View Post
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.
 
Old 12-06-2016, 02:02 PM   #33
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
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

Last edited by ParanoiaUser; 12-06-2016 at 02:05 PM.
 
Old 12-06-2016, 02:07 PM   #34
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,237

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
  • 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?
 
Old 12-06-2016, 02:12 PM   #35
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 417

Rep: Reputation: 74
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?
 
Old 12-06-2016, 02:42 PM   #36
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
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

Last edited by ParanoiaUser; 12-06-2016 at 02:45 PM.
 
Old 12-06-2016, 02:48 PM   #37
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 417

Rep: Reputation: 74
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.
 
Old 12-06-2016, 02:54 PM   #38
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by c0wb0y View Post
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.

Last edited by ParanoiaUser; 12-06-2016 at 02:57 PM.
 
Old 12-06-2016, 03:00 PM   #39
c0wb0y
Member
 
Registered: Jan 2012
Location: Inside the oven
Distribution: Windows
Posts: 417

Rep: Reputation: 74
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.
 
Old 12-06-2016, 03:04 PM   #40
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
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.

Last edited by ParanoiaUser; 12-06-2016 at 03:08 PM.
 
Old 12-06-2016, 03:39 PM   #41
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
Quote:
Originally Posted by ParanoiaUser View Post
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

Last edited by BW-userx; 12-06-2016 at 03:54 PM.
 
Old 12-06-2016, 03:43 PM   #42
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by ParanoiaUser View Post
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.

Last edited by Habitual; 12-06-2016 at 03:46 PM. Reason: LQ Volunteers
 
Old 12-06-2016, 03:50 PM   #43
ParanoiaUser
Member
 
Registered: Jun 2013
Posts: 40

Original Poster
Rep: Reputation: Disabled
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.

Last edited by ParanoiaUser; 12-06-2016 at 04:44 PM.
 
Old 12-06-2016, 04:03 PM   #44
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,237

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
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/
 
Old 12-06-2016, 04:06 PM   #45
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
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.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
changing the default permission for both directory and files to 775 with umask fermat97 Linux - Newbie 1 11-14-2014 07:02 AM
New user group permission to only three folders without being owner zilexa Linux - Newbie 8 07-09-2014 11:57 PM
Can you make any files and folders created within a directory owned by another user?? helptonewbie Linux - Newbie 13 12-14-2007 04:21 PM
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 06:14 AM
permission 775 to all folders and sub... amer_58 Linux - Newbie 3 04-23-2005 04:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration