AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
#Operatingsystems
#Servers
 View Only
  • 1.  Password security when calling curl from a shell script

    Posted 04/29/10 11:24 AM

    Originally posted by: shyhc


    Hello @all,

    I want to improve a shell script that has several curl calls (to a datapower box) and want to avoid that the user has to enter his (personal) passphrase every time.
    My idea is to query the password into a (non-exported) variable in the script and use something like
    
    curl .... -K - ... << EOF -u $
    {user
    }:$
    {password
    } EOF
    

    where -K - instructs curl to read command line parameters from stdin (actually a redirected config file), and -u user:password is the way to pass these to curl.
    When using it in the command line itself, the complete << .. here document appears in the shell history, but when called from a script, this does not happen.

    Is there a security hole in this solution? Could anyone see the here document or get access to the variables when they are not exported to the environment? Any experts have a suggestion?

    Thanks a lot & kind regards,
    Stefan
    #AIX-Forum


  • 2.  Re: Password security when calling curl from a shell script

    Posted 04/29/10 09:20 PM

    Originally posted by: SystemAdmin


    Hi,

    These are command line options, so just append the -u and variables to the command line. No need for a here document.

    Regards, George
    #AIX-Forum


  • 3.  Re: Password security when calling curl from a shell script

    Posted 04/30/10 02:47 AM

    Originally posted by: shyhc


    Sure you are right, but then a simple ps will show the password in the curl command line, which I want to avoid....
    Thx & Regards,
    Stefan
    #AIX-Forum


  • 4.  Re: Password security when calling curl from a shell script

    Posted 04/30/10 12:04 AM

    Originally posted by: zstarsales04


    Zstar Electronic Co.Ltd, Sell fire cards for DS/NDSL/NDSi, also have Wii, DSiLL, NDSi, NDSL, PSP2000, PSP3000, PS2, PS3, PSP go, PSP, Xbox360 accessories, all kinds of phones are available
    www.zstar.hk
    #AIX-Forum