Encrypting password in shell script on Solaris 10.

Hi,
I have a shell script & in that the username & password is specified. I can see the password. Is there any way to encrpyt password in Unix scripts on solaris 10 box.
Please suggest.
Thanks & Regards,
Tejas

Here are some examples of avoiding passwords in scripts.
First, if it's a script that needs to use remote login, you could set up ssh keys in the authorized_keys file of the remote system to allow auto-authentication.
As a more general example, you could create a shell function that prompts for the password and stores it in an environment variable to be used by the script or utility that you want to use. Here is an example that we use in our Red Hat systems to allow yum to tunnel through our http proxy:
function yumproxy(){
    echo -n "Enter Proxy Username: "
    read -e username
    echo -n "Enter Proxy Password: "
    read -es password
    echo
    export http_proxy="http://$username:$password@ourproxyserver:8080/"
}This is in .bashrc so that we can run it once just before running any yum commands (not that this means anything in a Solaris forum!)

Similar Messages

  • Xgettext for perl and shell scripts on Solaris 9

    Hi......I have to internationalized perl and shell scripts on Linux and Solaris 9.
    I have used gettext on linux to internationalized both perl and shell scripts but on solaris i m not able to
    achieve the same.
    If we see help of xgettect on Linux, it shows input file options for Perl, Shell, C, C++ etc but help for
    xgettext on Solaris shows input file option for C only.
    Can you please provide me some way of using xgettext for perl and shell scripts on Solaris 9 or
    is there any other way of internationalizing perl and shell scripts on Solaris 9.
    Many Thanks,
    Lokesh

    Signature link blocked.
    db
    Contentprise wrote:
    Hi......I have to internationalized perl and shell scripts on Linux and Solaris 9.
    I have used gettext on linux to internationalized both perl and shell scripts but on solaris i m not able to
    achieve the same.
    If we see help of xgettect on Linux, it shows input file options for Perl, Shell, C, C++ etc but help for
    xgettext on Solaris shows input file option for C only.
    Can you please provide me some way of using xgettext for perl and shell scripts on Solaris 9 or
    is there any other way of internationalizing perl and shell scripts on Solaris 9.
    Many Thanks

  • Encrypt sensitive passwords in shell script - Which one do you prefer ?

    Hi ,
    I am looking for various options to encrypt a sensitive password in a unix shell script. After a bit of googling, I learned about 'shc'.
    Can you please advice on what things you use for this purpose, if any ?
    My requirement / idea is
    A .sql file will have to be executed by a shell script in SQLPLUS as USER/XXXX . The .sql file will be prepared by developer and will be put to a directory to which their osuser - say 'user1' will have write access. I will have 'oracle' user in the server , who is the DBA user. I want them to run this SQL like, runthis.sh test.sql where runthis.sh is owned by oracle user and will reside in some directory owned by DBA user. I am planning to configure schema password (USER/XXXX) in runthis.sh , which a developer is not supposed to know.
    But if I give execute permission for 'user1' to runthis.sh, it becomes readable and all can read the password. Is there anyway , I can store encrypted password in SQLPLUS connect string in this file / encrypt shell script as such ?
    Thanks in Advance.
    With Regards,
    SSN

    The Oracle account should be identical to the O/S account, and set up as 'externally identified'
    But heck, why I am explaining it when it is all on your doorstep, accessible 7 x 24 hrs, at http://tahiti.oracle.com
    Sybrand Bakker
    Senior Oracle DBA

  • How to use encoded password in shell script ?

    Hi everybody,
    For make a load file in oracle table, I'm using a LKM File to Oracle updatding with a sqlldr (shell script).
    My problem is very simple : For security reason in this shell-script , I don't want to see in clear the password of the Oracle user for database connection. Is it possible and how do it ?
    Thanks in advance

    Hi-
    Yes it is possible by the way of KM custamization, You need to modify LKM call sqlldr via jython step to pass the user info and password as variable instead of ODI method. Try this command in your KM step:
    userid=#GLOBAL.user/#GLOBAL.psw
    Hope this will work for you.
    Thanks,
    Saravanan Rajavel

  • Using Encrypter password in Hyperion Scripts

    Hi Gurus,
    I want to use encrypted password sin the Hyperion scripts.
    We are using automated jobs which run cube refrshes, exports and various other operations but the problem is that these scripts use admin password.
    So if we view the script the password is also visible, so need to use encrypted password.
    i know we have openssh, crypt kinf of function for encrypting the passowrd, but i am not sure if the maxl will recognice the encrypted passowrd.
    Also if i encrypt a password will that cause any problem in the shared services ?
    Awaiting response
    Thanks in Advance ,

    If you are using Maxl then you can encrypt the scripts, for an example have a read of Encrypting passowrd in maxl
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Add Password to Shell Script for ssh

    Hi I'm trying to avoid creating ssh keys for this I was hoping to write it all in to applescript.
    This is what I have.
    I've done lots of searches, but not quite getting the right outcome.
    Matt
    set ShellS to "rsync -aE --progress --delete --exclude=\"._*\" /Volumes/Images/2014-2015 [email protected]:/Volumes/ImagesB/ "
    do shell script ShellS

    Thanks, that did help, I wondered what all those extra files were,
    Now searching the net this is where I am at., But I get the error
    error "invalid command name \"rsync\"
        while executing
    \"rsync -a --progress --delete --exclude=\"._*\" -e ssh /Volumes/Images/2014-2015 [email protected]:/Volumes/ImagesB/ \"" number 1
    set sshPasswd to "PSW"
    set ShellS to "rsync -a --progress --delete --exclude=\"._*\" -e ssh /Volumes/Images/2014-2015 [email protected]:/Volumes/ImagesB/
    expect {
      \"Password:\" {
          send \"" & sshPasswd & "\\r\"
          exp_continue
        \"yes/no?\" {
          send \"yes\\r\"
          exp_continue
    do shell script "expect <<<" & quoted form of ShellS

  • Passing password from shell script to Java

    Hi there,
    I have a shell script which has user id and password stored in variables. I call a java program from this shell script. I tried accessing this environment variable from java using system.getproperty and java is not getting the values. I have used export USERID PASSWORD
    and java classname to call it.
    I do not want to pass it as arguments because of security reasons. can anybody help me please.
    Thanks a bunch.

    Hi there,
    I have a shell script which has user id and
    password stored in variables. I call a javaprogram
    from this shell script. I tried accessing this
    environment variable from java using
    system.getproperty and java is not getting the
    values. I have used export USERID PASSWORD
    nd java classname to call it.
    Presumably you are using one of the newer java
    versions.
    Questions
    1. What statements are you using to set, export and
    run java?
    2. What shell are you using?
    3. How are you accessing the vars in java?
    I do not want to pass it as arguments because of
    security reasons. can anybody help me please.
    That is nonsensical. Putting it in env vars exposes
    it more than passing it as args.Thanks for replying jschell.
    1. I am using newer version java 1.5
    2. shell scripts gets it's variables from oracle reports through webservices.
    3. to run java i use java javaclassname3. I used EXPORT variablename and in java called system.getproperty(variablename)But system.getproperty is getting a null.
    And the decision about not passing it as args was made by our client. They think it's not safe to pass password.
    are they wrong??
    Please help me.

  • How to create shell script on solaris "TOP" command

    Hi All,
    i need to write a shell script on unix top command.
    Requirement:
    In top command grep the more than 25% CPU utilization f60webmx process and that f60webmx process time stamp is more than 3HR's and also needs to grep the load average information in top command.
    Please help me some one.

    i need to write a shell script on unix top command.You have our permission to begin to do that.
    These forums are NOT for doing your work for you. They are here to provide assistance for YOUR work.
    I suggest you go get paper and pencil and write down all the steps you think you need to take to accomplish that. Write it down as if you were going to do that manually at the command prompt. Then put it all into a text file and save it with a file name of your script.
    When you have that "script", you can run it and examine whether it succeeds or whether it has errors. Work at it for a while and fix whatever errors might happen.
    When you are really, really stuck at it, you can paste your script into a reply of this thread and maybe someone will respond with suggestions for improvement.

  • Need steps to run a shell script at solaris startup

    Hi Forum,
    I have a simple script which need to get executed at the time of solaris 10 system startup. Can any one tell me procedure to make the script run at startup in solaris 10 sparc systems.
    Regards
    Prakash

    The best way is to setup a SMF manifest so that the svc process can handle your program. The easiest way however is to simply put the script within the legacy init.d structure. Check out /etc/init.d and the README file in there. Also be sure to look into the init.d(4) manualpage.
    Easiest way IMO.

  • How to perform addition of two numbers in shell scripting in Solaris-10

    Hi,
    I have a sh script which contains the following line
    TOTAL=$((e4-s4)) -> Where e4 and s4 are input got from the user.
    At the time of execution of this line the following error occurs
    test.sh: syntax error at line 8: `TOTAL=$' unexpected
    How to solve this issue?. Can any one help me please?.........................
    Regards
    Revathi

    Again Same error persisted.
    Below is my script
    +#!/bin/bash+
    echo "Enter the start IP"
    IFS="."
    read s1 s2 s3 s4
    echo "Enter the End IP"
    IFS="."
    read e1 e2 e3 e4
    TOTAL=$(($e4 - $s4))
    echo "Total is $TOTAL"
    The output is
    *#!/bin/bash*
    echo "Enter the start IP"
    IFS="."
    read s1 s2 s3 s4
    echo "Enter the End IP"
    IFS="."
    read e1 e2 e3 e4
    TOTAL=$(($e4 - $s4))
    echo "Total is $TOTAL"
    Any idea

  • Shell Script For Export And Import Of Table Records

    Hello,
    We have production and test instances and for constant testing we need to copy data from production to test or development environment.
    At the moment what we do is manually doing export and import table records. At times this could be very tedious as we may need
    to do this exercise a couple of times in a day.
    Is it a good idea to do this exercise using shell script? If so how could I do this? If this is not a good idea what are the best alternatives?
    Any input is highly appreciated.
    Thanks

    Ah I see, your company prefers stupidity over efficiency. It would be possible to do it in a controlled environment, wouldn't it? Also the test database would be allowed to select only.
    So the non-allowance is just plain stupid.
    To the second question: do you use hard-coded passwords in shell scripts?
    Don't you think that poses a security risk?
    Don't you think that is a bigger risk than a database link, properly set up?
    In my book it is!
    Sybrand Bakker
    Senior Oracle DBA

  • Statspack report generation shell script?

    Does anyone have a shell script (unix/solaris) which does the following:
    Gets the snap_ids from the 09:00 and 17:00 statspack snapshots (from today or yesterday), and runs spreport.sql, using these snapshot ids as begin_snap and end_snap.
    I do not want to purge any snapshots from the database. I simply want to generate a daily "9 to 5" statspack report every day.
    TIA,
    Dave

    Hi,
    You can do the following way:
    1. Write script to get the begin snap_id as:
    $cat > begin_snap.sql
    set head off
    set echo off
    set verify off
    set termout off
    spool begin_snap_id.log
    SELECT snap_id
    FROM stats$snapshot
    WHERE TRUNC(snap_time) = TRUNC(SYSDATE-1)
    AND TO_NUMBER(TO_CHAR(snap_time,'HH24')) =9;
    spool off
    2. write a script to get end snap id as same as above substituting 9 with 17 with script name as end_snap.sql and spool file name as end_snap_id.log.
    3. write a script to pass arguments for spreport.sql as:
    cat > statspack_report
    #!/bin/ksh
    ORACLE_HOME=/home/oratest
    TODAY=`date '+%Y%m%d' `
    REPORT=report_${TODAY}.txt
    sqlplus -s perfstat/perfstat@database_name @$ORACLE_HOME/begin_snap.sql <<EOF
    EOF
    BEGIN_ID=`cat /home/oratest/begin_snap_id.log | sed '/^$/d' `
    sqlplus -s perfstat/perfstat@database_name @$ORACLE_HOME/end_snap.sql <<EOF
    EOF
    END_ID=`cat /home/oratest/end_snap_id.log | sed '/^$/d' `
    sqlplus -s perfstat/perfstat@database_name @$ORACLE_HOME/rdbms/admin/spreport.sql <<EOF
    ${BEGIN_ID}
    ${END_ID}
    ${REPORT}
    EOF
    you can schedule this statspack_report in a crontab.
    thanks
    srinivas.

  • How to switch user from the current user using shell script code

    Hi Experts,
    I have an requirement to login into a particular user from the shell script concurrent program. I do have credentials for that particular user. I want to login and run few commands from that particular user. Please let me know if there are any methods to login as a particular user using the username, password from shell script program.
    Thanks a lot.

    Thanks for your reply. However we cannot use su command from a shell script program. How to enter password from shell script program?http://tinyurl.com/3t7cwjh
    Thanks,
    Hussein

  • Shell script for RMAN backup

    Hi,
    on 10G R2 in AIX 6.1
    I'm looking for Shell script for RMAN backup.
    Moreover , if we should connect like this :
    rman nocatalog target sys/password@myDB << EOF
    backup as compressed backupset format '$savdir/ctl_%d_%T_%s_%p' current controlfile;
    exit
    EOFHow to avoid writting password in shell script ?
    Thank you.

    user522961 wrote:
    Can you please tell me in case of having a catalog , how to connect to catalog without writting password in script ? I mean , how to write the following in a way without password :
    #!/usr/bin/ksh
    export ORACLE_SID=myDB
    ORACLE_ENV_ASK=NO
    . /usr/local/bin/oraenv
    export savedir=/backups/myDB
    rman target /  << EOF
    connect catalog rman/password@myrepository
    backup as compressed backupset
        format '$savdir/ctl_%d_%T_%s_%p'
        include current controlfile;
    exit
    EOF:p

  • Finishing up this Do shell script

    Hey guys,
    I am trying to wrap up this script, no pun intended. My goal is to run four commands. A DHCP release, a pause, a renew, then output of the DHCP server address. I am fine until the last command to get the output of DHCP server address.
    Within the terminal, I can run ipconfig getpacket en0, and it will give me tons of info, including the DHCP server.
    The Apple script errors out on that last command, and I would love the info grepped and outputted to a dialog box or a terminal window. Here is what I have so far. Any help is appreciated.
    do shell script "sudo ipconfig set en0 BOOTP" with administrator privileges
    do shell script "/bin/sleep 60"
    do shell script "sudo ipconfig set en0 DHCP" with administrator privileges and password
    do shell script "ipconfig getpacket en0" with administrator privileges and password
    I am doing this as we are moving to a different DHCP server, and my boss wants to verify the cutover happened.
    Thanks,
    DB

    Hi DB,
       If I understand the "with administrator privileges" modifier correctly, it uses sudo without need for you to put it in the command. Thus if I'm correct in that regard, your use of sudo is redundant, although as you know, it will work. Second, the "ipconfig getpacket en0" command works for me without using sudo. I'm sure that's not true of the release/renew commands but it appears to be true of the last one. Of course it doesn't hurt to run the command as root so that certainly isn't the problem either.
       You could test this yourself but the problem appears to be that the exit status of the ipconfig command you posted is 1, which means an error. I know it returns nice data but the AppleScript interpreter sees the error and thus itself fails. There is a simple workaround that is a hack but it works. You can put more than one command in a "do shell script" statement by separating the commands with a semi-colon. Thus you can follow the ipconfig command with another command that succeeds. For instance, the following should work:
    do shell script "ipconfig getpacket en0;:"
    Here I've added a colon after the semi-colon. The colon is a shell command that does nothing but always succeeds.
       Of course the correct approach would be to figure out why ipconfig returns an error and fix the problem. I apologize but I don't use the command much so don't know what is causing the error.
    Gary
    ~~~~
       Whoever dies with the most toys wins.

Maybe you are looking for

  • How to restore a replicated (publisher) database

    Hi,  SQL 2008R2 Been having issues with this for a while so I thought to test the whole procedure in a sandpit project.  Below are the steps I've taken, however the problem I have is that after a restore my publication has disappeared and therefore t

  • FPGA crio

    Buenos días a todos. Llevo un tiempo trabajando con Crio ni-9022 y un chasis que incluye FPGA , y me da unos errores cuando compila la FPGA, que me son imposible de detectar ya que nombre variables a nivel de FPGA. El fallo es el siguiente: LabVIEW F

  • Oracle 6.2 on Oracle VM installs ok, doesn't do much on first boot up

    I installed Oracle Linux on Oracle VM and the installation steps seem to succeed, but when I boot up the guest there is no gnome desktop or networking (can't ping oracle.com). However, if I run the install again in rescue mode and go to the shell I c

  • RSBOLAP 000 and RS_EXCEPTION 105 ERROR in BW

    Hello SAP Guru, I am using BI 7.X(Based on 7.10) Support Package 9, Patch 1 Revision 1507 When I am using the filter in Bex for DATE,DIVISION and DISTRIBUTION CHANNEL, I am getting the following error. RSBOLAP            000 Program error in class SA

  • Hiding programs....help????

    iphoto is hiding from me, when i click f3 it shows up as open but when i click on it the program hides, when i swipe with four fingers it comes up, but i can't have it open on my screen...help please??? how do i get this to stop???? it is opening, it