chroot help
Im reading the man page but its short and it doesnt show examples......I want to chroot jail /home/example so that my user 'example' cannot cd into other directories?
|
chroot <chroot_dir> <command_to_run>
eg. chroot /foo /bin/sh # run the shell in the chrooted environment |
Hmm........but I would like to assign a certain user that does not have root access. Is this going to cause problems?
chroot /home/example /bin/zsh ? |
The chroot command is used to make a new root folder, this means that anyone, user or command, are totally unable to reach ANYTHING outside of that directory branch. So if you would set another root for a user he wouldn't be able to do anything (if he would be able to login at all), since all commands are outside of his "root-jail".
|
chroot is a privileged cmd, it will only run as root.
|
Add this to /etc/profile (at the end) but changing the uid to the user.
Code:
if [ "`id -u`" = UID ]; then |
This could work if you compile a static version of sh and put in in /home/example/bin
|
Quote:
|
Quote:
http://www.unixwiz.net/techtips/chroot-practices.html |
chroot command is not working
hi ,
i am trying to execute chroot command but i was not successful chroot /mnt/ubuntu dpkg -i somepackage-name it showing following error: chroot : command fail to run dpkg:No such file or directory. pleaes help me on this. regards, prasad. |
need chroot example
hi
i need one command which successful executes with using chroot. |
Quote:
This also answers you other question: try a command which is in root's path. PS I just saw that you asked a similar question here. I'd suggest you open your own thread to attract more attention, including all details needed for the readers to understand what you try to achieve. To do that, just go back there and hit "New thread". |
Quote:
|
Have you looked at starting the user shell (probably BASH) in restricted mode? Form the manual page for BASH:
Quote:
Hope this helps some. |
C'mon guys, don't feed the zombies. This was a NINE years old thread. The person who is trying to resurrect the thread apparently needs two posts (out of his LQ total of three) to ask the same Ubuntu-related question. This is a Slackware forum thread!
Eric |
All times are GMT -5. The time now is 09:18 PM. |