View Single Post
  #1   (View Single Post)  
Old 8th August 2010
kallistoteles kallistoteles is offline
New User
 
Join Date: Jun 2010
Posts: 5
Post Chroot Noip client

Hi

I use No-ip to get a hostname for my server. It's easy and the basic functions are free. You need to create an account there first for this to work.
This is how you chroot noip client on OpenBSD.

Install no-ip client
Code:
# pkg_add no-ip
Make a directory that will be the new root for the noip2
Code:
# mkdir /var/noip2
Add a user that will run the noip2 command.
Code:
# useradd -d /var/noip2/ -s /sbin/nologin noip2
Copy the commandfile to it's new home
Code:
# mkdir /var/noip2/bin
# cp /usr/local/sbin/noip2 /var/noip2/bin/
Displays the shared objects needed to run noip2
Code:
# ldd /var/noip2/bin/noip2
/var/noip2/bin/noip2:
        Start    End      Type Open Ref GrpRef Name
        1c000000 3c00a000 exe  1    0   0      /var/noip2/bin/noip2
        052fb000 25334000 rlib 0    1   0      /usr/lib/libc.so.53.1
        0bb09000 0bb09000 rtld 0    1   0      /usr/libexec/ld.so
Copy them to their new home
Code:
# mkdir -p /var/noip2/usr/{lib,libexec}
# cp /usr/lib/libc.so.53.1 /var/noip2/usr/lib/
# cp /usr/libexec/ld.so /var/noip2/usr/libexec/
Preparing configuration
Code:
# mkdir /var/noip2/etc
# chown noip2 /var/noip2/etc
Noip2 uses gethostbyname, that uses resolv.conf. If we don't put it there we will get an error like "Can't gethostbyname for dynupdate.no-ip.com"
Code:
# cp /etc/resolv.conf /var/noip2/etc/
Now we can create the config file
Code:
# chroot -u noip2 /var/noip2 /bin/noip2 -C
! For security we want root to own all the files and directories except /var/noip2/etc and /var/noip2/etc/no-ip2.conf !

The only thing left is to start noip2
Code:
# chroot -u noip2 /var/noip2 /bin/noip2
Reply With Quote