SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Giving chrooted user access to mysqldump

  1. #1
    SitePoint Enthusiast sciguy's Avatar
    Join Date
    Mar 2006
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Giving chrooted user access to mysqldump

    I have a chrooted ftp user that I use on my server. I would like to run a cron job using this user that backs up my mySQL databases. When I execute the job, it complains about date and mysqldump not existing. I was able to fix the date problem simply by copying it from the actual /bin to the chrooted /bin. However, I can't simply copy mysqldump because it depends on several libraries. Anybody know how I can give this chrooted user access to commands that aren't in his chroot?
    Dont even consider it.

  2. #2
    Do. Or do not. There is no try silver trophy
    SitePoint Award Recipient ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,347
    Mentioned
    87 Post(s)
    Tagged
    2 Thread(s)
    Chrooting the user in FTP does not chroot it on your entire server does it?
    Try to put the whole path to mysqldump in your cron job (if you haven't done so already) and see if this works.

    If this doesn't work you could
    • make a symlink to mysqldump in the users chroot /bin
    • mount --bind the directory mysqldump is in to the users chroot is in (not recommended, need to run this command every server reboot or add it to /etc/fstab)
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Enthusiast sciguy's Avatar
    Join Date
    Mar 2006
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the advice. For security reasons, the user is completely chrooted. Even when logged in via ssh. So symlinking isn't working, and I would prefer not to mount. Perhaps I'll just make another user to do this...
    Dont even consider it.

  4. #4
    SitePoint Enthusiast sciguy's Avatar
    Join Date
    Mar 2006
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I ended up making a seperate user for this purpose, and it works fine. Howevever, I now have another issue. I've made a cron job in plesk, but nothing happens...I get no notification, and nothing gets written to my log file. The files are setup so that only my new user has execute permissions, and the cron is being run under that user. Ideas on why this would happen?
    Dont even consider it.

  5. #5
    SitePoint Enthusiast sciguy's Avatar
    Join Date
    Mar 2006
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the commands work fine when I run them under the same user from the command line, so why wouldn't they work via a cron job?
    Dont even consider it.

  6. #6
    SitePoint Addict
    Join Date
    Oct 2008
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try su as that same user and run the commands from shell ?
    ------------
    hzSari | HostingZoom.com
    ModVPS.com | ResellerZoom.com
    Power Speed Reliability

  7. #7
    SitePoint Enthusiast sciguy's Avatar
    Join Date
    Mar 2006
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not certain I understand what you mean. I already can run the commands fine from shell as that user without granting su.
    Dont even consider it.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •