• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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