Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

[request] Create user with restricted access to 1 directory.

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
finalturismo
Guru
Guru
Posts: 410
Joined: Mon Jan 06, 2020 4:53 pm

[request] Create user with restricted access to 1 directory.

  • Quote

Post by finalturismo » Tue Sep 22, 2020 7:36 pm

So iam setting up an autotunnel that is being used on some software iam deploying to a client.

I need to restrict the user to that 1 folder but let them do what ever they want in that 1 folder.

When the user is logged onto my server it will be dropping logs and other data into that folder with a cronjob.

But i do not what to take any risk with my server and need to make sure they are jailed into that 1 folder.

When the tunnel is setup this allows me to go ahead and ssh backwards to there system and helps me bypass any firewalls.

Pretty much i need a chroot jail for a new user iam making on the server.

So when they tunnel / login to my server they are restricted to that 1 folder.

This will allow me to rsync entire directors and logs to that folder but keep my server safe.

iam stuck on the chroot jail... and i know there has to be an easy way to do this.
Top
alamahant
Advocate
Advocate
Posts: 4032
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Wed Sep 23, 2020 3:09 pm

Hi,
use something like sftp chroot:
in sshd_config append:

Code: Select all


Subsystem sftp internal-sftp
#
Match Group sftp_users
  ChrootDirectory <dir>
  ForceCommand internal-sftp

Then create the group and add your specific user to this group.
:D
Top
finalturismo
Guru
Guru
Posts: 410
Joined: Mon Jan 06, 2020 4:53 pm

  • Quote

Post by finalturismo » Thu Sep 24, 2020 4:47 am

alamahant wrote:Hi,
use something like sftp chroot:
in sshd_config append:

Code: Select all


Subsystem sftp internal-sftp
#
Match Group sftp_users
  ChrootDirectory <dir>
  ForceCommand internal-sftp

Then create the group and add your specific user to this group.
:D
Thanks man, great info!!

I will mark the thread as solved.

1 thing i have noticed about this forum is that when you ask a question you almost always get a good answer, unlike some of the people on the linuxquestions forums. XD

So far i went with a restricted tunnel using /bin/false as the shell but i think i might take this route instead iam not sure yet.
Top
Post Reply

3 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic