How to correct Openvpn with elevated rights while being an ordinary user?

7,883

Solution 1

Yes, of course you can compile stuff as a regular user and point the configure script to it. Run configure --help and you'll probably see where it talks about setting environment variables like LIBPAM_LIBS and LIBPAM_CFLAGS. Set these manually to the location where the shared libraries (.so files) and headers (.h files) for a compiled libpam are.

I would advise that you set up a "local prefix" where openvpn and all of its dependencies can be aggregated. Think of this prefix as your own /usr directory.

Looks like from your setup that you're already setting --prefix to /home/mirror/build/ins/ins_vpn, so then /home/mirror/build/ins/ins_vpn/include would be the value to set for the environment variable LIBPAM_CFLAGS and /home/mirror/build/ins/ins_vpn/lib would be the value to set for the environment variable LIBPAM_LIBS. Of course, the environment variable names may vary depending on what configure --help says. So run it and read it.

You could also set PKG_CONFIG_PATH environment variable to /home/mirror/build/ins/ins_vpn/lib/pkg-config and the libpam make install step should push libpam.pc into that directory when installing (if you configure it with --prefix=/home/mirror/build/ins/ins_vpn). By setting PKG_CONFIG_PATH, you are instructing the pkg-config utility to look in that directory for .pc files, which contain data about the compilation and linking flags for programs. Many standard libraries use pkg-config and autoconfig, so you should be able to repeat these steps for any other packages.

Obtaining a proper version of libpam sources is probably just a matter of downloading the source rpm and unpacking the sources, or just figure out which version of libpam upstream your distro uses and grab that version (or a later version will probably work too).

Note that since you don't have root access on the box, you probably can't manipulate tun or tap devices (unless the sysadmin has given you privileges), so you probably won't be able to create a useful VPN tunnel without root anyway, even if you compile openvpn :)

Solution 2

yum install gcc make rpm-build autoconf.noarch zlib-devel pam-devel openssl-devel -y

This will resolve all the dependencies

Share:
7,883

Related videos on Youtube

hugemeow
Author by

hugemeow

http://serverfault.com/search

Updated on September 18, 2022

Comments

  • hugemeow
    hugemeow almost 2 years
    checking tap-windows.h presence... no
    checking for tap-windows.h... no
    checking whether TUNSETPERSIST is declared... yes
    checking for setcon in -lselinux... yes
    checking for pam_start in -lpam... no
    checking for OPENSSL_CRYPTO... yes
    checking for OPENSSL_SSL... yes
    checking for EVP_CIPHER_CTX_set_key_length... yes
    checking for ENGINE_load_builtin_engines... yes
    checking for ENGINE_register_all_complete... yes
    checking for ENGINE_cleanup... yes
    checking for ssl_init in -lpolarssl... no
    checking for aes_crypt_cbc in -lpolarssl... no
    checking for lzo1x_1_15_compress in -llzo2... no
    checking for lzo1x_1_15_compress in -llzo... no
    checking for PKCS11_HELPER... no
    checking git checkout... yes
    configure: error: libpam required but missing
    [mirror@innov openvpn]$ ./configure --help | grep libpam
      --enable-pam-dlopen     dlopen libpam [default=no]
                  C compiler flags for libpam
      LIBPAM_LIBS linker flags for libpam
    [mirror@xxx openvpn]$ ./configure --prefix=/home/mirror/build/ins/ins_vpn --disable-lzo 
    

    error: libpam required but missing

    I just have no privilege to install the package named libpam, so can I build libpam and install it in home directory, then build openvpn based on it?