• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

mysql and svn command usage from SSH chrooted environment?

A

acidbox

Guest
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.
 
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.
 
Originally posted by mikk
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.

How can I get it to use the correct database files that are stored outside the chrooted environment?
 
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.
 
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?
 
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
 
Back
Top