Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I don't think anyone is going to be able to help without more information. Both links you posted are multi-step and you failed to indicate at which step it failed or for that matter, which link tutorial you used. "It won't work" is not helpful so if you want help, details.
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364
Rep:
Hi dushyantg,
Yancek (above post) has a point - more details would still help.
By "limiting access to home", do you mean read-only elsewhere, or no permissions at all (i.e. can't even view directory contents ...) ? Explaining what you are trying to do this for would also help.
I suppose changing the permissions on the entire file system to 700 would allow only root to view, list, read or write in any directories other than /home/$user$ ... I guess using the appropriate masks in fstab would be the easiest way to do this (probably 077) ... Still - we're shooting in the dark here until you provide more context.
If you have the following lines appended to /etc/ssh/sshd_config
Code:
Subsystem sftp internal-sftp
Match group sftpusers
ChrootDirectory %h
ForceCommand internal-sftp
Then it will chroot the SFTP session to the users' home directory. So that directory has to be owned by root and not writable by anyone, not even the user. There are two ways to deal with that.
1) You can have root create files and subdirectories and have them owned by the user. That has the disadvantage that anything in the users' directories has to be created manually by root.
2) You can create a subdirectory in the chroot with the users' name and otherwise work as normal. The disadvantage is that some think it looks funny to those outside the chroot. Then you can chroot to the home directory and start the session within the subdirectory.
Code:
Match group sftpusers
ChrootDirectory %h
ForceCommand internal-sftp -d %u
I have created a user XYZ and its having its home directory now I want XYZ to have full access on its home directory and he/she can have 777 permission on that but rest of all files it will not have even 700, I mean that user can't access rest of the files/directories not even read permission.
I have created a user XYZ and its having its home directory now I want XYZ to have full access on its home directory and he/she can have 777 permission on that but rest of all files it will not have even 700, I mean that user can't access rest of the files/directories not even read permission.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.