1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

mysql and svn command usage from SSH chrooted environment?

Discussion in 'Plesk for Linux - 8.x and Older' started by acidbox, Nov 1, 2005.

  1. acidbox

    acidbox Guest

    0
     
    i want my users to be able to use the mysql and svn command line utilties from SSH, but I want them to only have access to their chrooted envirnoment. Is this possible?

    Note: I tried creating a symlink to the real files but it doesnt let them reach it.

    Any help would be appreciated.
     
  2. mikk

    mikk Basic Pleskian

    23
    73%
    Joined:
    Jan 29, 2005
    Messages:
    83
    Likes Received:
    0
    I know its possible on mysql, but u need to actually copy the binaries and the needed libs into the chroot enviroment

    run a ldd on the mysql binary to check which libraries you need and copy them to the relevant directories

    depending on how you deal with the mysql socket you may find you need to use -h 127.0.0.1 instead of trying to use the socket to connect to the database server.
     
  3. acidbox

    acidbox Guest

    0
     
    How can I get it to use the correct database files that are stored outside the chrooted environment?
     
  4. mikk

    mikk Basic Pleskian

    23
    73%
    Joined:
    Jan 29, 2005
    Messages:
    83
    Likes Received:
    0
    Im using BSD so maybe a little different but the files you need are simply:

    # ldd /usr/local/psa/mysql/bin/mysql
    /usr/local/psa/mysql/bin/mysql:
    libncurses.so.5 => /usr/lib/libncurses.so.5 (0x28099000)
    libcrypt.so.2 => /usr/lib/libcrypt.so.2 (0x280da000)
    libstdc++.so.3 => /usr/lib/libstdc++.so.3 (0x280f3000)
    libm.so.2 => /usr/lib/libm.so.2 (0x28138000)
    libc.so.4 => /usr/lib/libc.so.4 (0x28153000)



    The mysql server is still ran on the main server hence me saying to connect to it using the -h (HOST) command - that way mysql within the chroot is purely a client and sends requests to the HOST mysql-server rather than try to go via the normal localhost socket.

    You may need to actually set the database that you wish to be accessed to be opened to external users if you have it locked to localhost only at this time.

    using main mysql dbase run:

    UPDATE db SET Host='%' WHERE Db ="DBNAME";
    UPDATE user SET Host='%' WHERE User ="USERNAME";
    FLUSH PRIVILEGES

    That will then open the said dbase/username combination to connection from any host.
     
  5. acidbox

    acidbox Guest

    0
     
    I'm more concerned with allowing the user to access the 'mysql' command line tool. The problem is that I don't know how to connect the tool to their database files, which are located outside the chrooted environment.

    Anyone?
     
  6. mikk

    mikk Basic Pleskian

    23
    73%
    Joined:
    Jan 29, 2005
    Messages:
    83
    Likes Received:
    0
    Did you not read my previous post?

    The use of the -h switch along with unlocking the allowed access to the dbase username.

    You are then accessing the dbase over a tcp/ip connection rather than through the unix mysql.sock
     
Loading...