Skip to content

Instantly share code, notes, and snippets.

@wcypierre
Last active December 20, 2015 07:39
Show Gist options
  • Save wcypierre/6095072 to your computer and use it in GitHub Desktop.
Save wcypierre/6095072 to your computer and use it in GitHub Desktop.
Copy binary with dependencies into a folder
cp /bin/sh /var/chroot/sshd/bin/;\
ldd /bin/sh|awk '{print $3}'|grep -e '^/'|xargs -I{} cp -v --parent '{}' /var/chroot/sshd/
Credits to: http://blog.jandorsman.com/2011/10/copying-a-binary-and-its-shared-libraries-to-a-chrooted-directory/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment