Last visit was: It is currently Thu Mar 28, 2024 8:02 am


All times are UTC-05:00




Post new topic Reply to topic  [3 posts ] 
    Author Message
     Post subject:Linux command question
    PostPosted:Tue Feb 17, 2009 8:33 pm 
    User avatar
     

    Joined:Sun Feb 12, 2006 8:56 pm
    Posts:1019
    Website:http://eddieringle.com
    Location:Detroit, MI
    Here's the deal, I am writing a script so that I can easily add pub keys for our git server. The problem is I need to add them as the git user. In the tutorial I ran through setting up gitosis it gave me:
    Code:
    sudo -H -u git gitosis-init < /tmp/id_rsa.pub
    I need to be able to run that command using PHP's system function or exec function. I've figured that I don't necessarily have to run it as git, just as a user in the git group with the correct privs.
    However, I must be able to use git's home directory as gitosis-init requires it (hence the -H in the sudo command). So is there anyway www-data can execute gitosis-init while using git's home directory?
    (obviously giving www-data sudo access is a huge security threat)

    _________________
    -- Eddie Ringle

    Check out Elysian Shadows and consider backing us on Kickstarter!

    ====================================

    Image


    Top
    Offline  
     Post subject:Re: Linux command question
    PostPosted:Sun Mar 01, 2009 2:53 pm 
    External Project Staff
    User avatar
     

    Joined:Sun Oct 30, 2005 3:40 pm
    Posts:371
    Website:http://idlesoft.net
    Location:~/
    Although it wont output to your current terminal (if you want this at all), it works:
    Code:
    sudo su -c "command"
    The command can be any normal sh command, like:
    Code:
    cd /root; touch him

    _________________
    -- ChaosR

    Image


    Top
    Offline  
     Post subject:Re: Linux command question
    PostPosted:Sat Mar 07, 2009 11:46 pm 
    User avatar
     

    Joined:Sun Feb 12, 2006 8:56 pm
    Posts:1019
    Website:http://eddieringle.com
    Location:Detroit, MI
    Quote:
    Although it wont output to your current terminal (if you want this at all), it works:
    Code:
    sudo su -c "command"
    The command can be any normal sh command, like:
    Code:
    cd /root; touch him
    Unfortunately sudo does not work when a user does not have sudo privs (go figure). I gave up on this anyways, GitHub seems to be doing a darn good job themselves, so I'll let them deal with these sorts of problems. :)

    _________________
    -- Eddie Ringle

    Check out Elysian Shadows and consider backing us on Kickstarter!

    ====================================

    Image


    Top
    Offline  
    Display posts from previous: Sort by 
    Post new topic Reply to topic

      All times are UTC-05:00


      Who is online

      Users browsing this forum: Google [Bot] and 27 guests


      You cannot post new topics in this forum
      You cannot reply to topics in this forum
      You cannot edit your posts in this forum
      You cannot delete your posts in this forum
      You cannot post attachments in this forum

      Search for:
      Jump to:  
      Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
      Theme created by Miah with assistance from hyprnova