LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is possible to mount devices in a chroot jail? (https://www.linuxquestions.org/questions/linux-newbie-8/is-possible-to-mount-devices-in-a-chroot-jail-803108/)

daurpam 04-20-2010 01:59 PM

Is possible to mount devices in a chroot jail?
 
Hello, and thanks in advance.
I would like to create a logon script, for specific user, under ssh connection, to backup several directories in a USB device; this backup will run when the device was plugged in and the user logs in server. My knowledge of linux isn't very deeply now, and some questions are in my head.
I would like to make this in a chroot jail, and the user log in through ssh connection doesn't have to make nothing, the logon script will mount the USB device and make the backup (using rsync or whatever), and exit the ssh connection when it finish.

Anyway the questions are:
- is possible that a user in a chroot jail mount a USB device?
- from this jail, the directories outside of the jail could be available or need to be bind or something for this task?
- it will be better to "jail" all the directories to backup, inside de chroot path (almost would be samba sharing for Windows clients)?

Well I apreciate your help.

Regards.

unSpawn 04-20-2010 03:16 PM

Making devices available inside a chroot may weaken the chroot. If the only function of the chroot is providing an environment for performing one single task (making backups) then you may be able to eliminate the chroot idea by limiting SSH access to that account to only run that task. See 'man sshd', under AUTHORIZED_KEYS FILE FORMAT, the command="command" part. If you allow this account to perform system backups it would be good to limit access to known good hosts. Adhering to SSH best practices (pubkey auth, not allowing root to log in, no unnecessary exposure, blocking access on repeated login failure) is always a Good Thing.

daurpam 04-20-2010 04:09 PM

Thank you so much
 
Thanks unSpawn for your helpful answer, I post in some forums with no response. Be a newbie in linux is a hard task, I'll follow your advices and I hope to find a solution through ssh.

Thanks again.
Daniel.


All times are GMT -5. The time now is 07:47 PM.