0

I'm really a noob on Ubuntu, I'm facing a simple problem that I don't find anywhere, I follow this tutorial to make an ssh jail directory

https://www.tecmint.com/restrict-ssh-user-to-directory-using-chrooted-jail/

I know that the user will not have some commands but I want to enable some to the user, in this tutorial have these commands to enable this :

# cp -v /bin/ls /home/test/bin/
# cp -v /bin/date /home/test/bin/
# cp -v /bin/mkdir /home/test/bin/

and there is too find the libraries for this commands :

ldd /bin/ls
# cp -v /lib64/{libselinux.so.1,libcap.so.2,libacl.so.1,libc.so.6,libpcre.so.1,libdl.so.2,ld-linux-x86-64.so.2,libattr.so.1,libpthread.so.0} /home/test/lib64/

I managed to make this commands work successfully but the "tail" command I try everything but nothing is working.

I use the ldd /bin/tailf ( tailf is the command? )

it displays some libraries I use the cp command and is not working, what I'm doing wrong?

wavrik
  • 101

1 Answers1

0

On Ubuntu, the command tail is located in /usr/bin/tail ( see also package information from related post ), so you want to do

ldd /usr/bin/tail

Note that in addition to copying the commands, you should either link or copy some of /lib directories, since some of the binaries rely on shared libraries stored there, in particular /bin/sh relies on that. See also: Change /bin/sh link temporarily

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
  • hi thanks for the answer but, my ubuntu is version 16.0.4 i dont have this file in bin/tail Just bin/tailf why? – wavrik Jan 08 '19 at 10:54
  • @user3515184 Well, that is strange. Ubuntu and its official "flavors" ship with /usr/bin/tail because it's from a standard package. The tailf is like tail -f, it's supposed to keep reading the file as new lines are added to it. As for why you only have /bin/tailf, I have no clue. Perhaps you have installed a modified Ubuntu or if you are using the system provided by a hosting service, then the sysadmins could have modified the Ubuntu image. – Sergiy Kolodyazhnyy Jan 08 '19 at 11:31
  • I must create a folder called /usr/ and put it in the folder?

    Like /home/jail/usr/bin/tail or just /home/jail/bin/tail? and the libraries

    – wavrik Jan 08 '19 at 18:40
  • @user3515184 Well, have you found tail yet ? If yes, make folder /home/jail/usr/bin and copy it there – Sergiy Kolodyazhnyy Jan 08 '19 at 18:49
  • thank you very much Sergiy, I'm found the tail and now is working fine. I'm glad that have people like you. – wavrik Jan 08 '19 at 19:05
  • @wavrik You're welcome. I'm glad to help. – Sergiy Kolodyazhnyy Jan 08 '19 at 19:09