<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Asking for user password while running a script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957834#M95009</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Who will be executing this script?&lt;BR /&gt;&lt;BR /&gt;If root is running it then you don't need a password. If a non-root user is running the script then one of the option is to to setup sudo.</description>
    <pubDate>Thu, 08 Mar 2007 12:44:59 GMT</pubDate>
    <dc:creator>linuxfan</dc:creator>
    <dc:date>2007-03-08T12:44:59Z</dc:date>
    <item>
      <title>Asking for user password while running a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957831#M95006</link>
      <description>I'm creating a script to auto start my oracle listener and open a startup the database automatically. Below is the script&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;su -oracle&lt;BR /&gt;export ORACLE_HOME=/cramerapps/oracleAS&lt;BR /&gt;echo $ORACLE_HOME&lt;BR /&gt;export ORACLE_SID=asdb&lt;BR /&gt;lsnrctl start&lt;BR /&gt;sqlplus "sys/syspassword @ asdb as sysdba" &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;startup&lt;BR /&gt;exit&lt;BR /&gt;EOF&lt;BR /&gt;~&lt;BR /&gt;&lt;BR /&gt;But after executing, the script will prompt for oracle password. How to skip the password prompt? How can i put the password into the script??</description>
      <pubDate>Thu, 08 Mar 2007 00:38:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957831#M95006</guid>
      <dc:creator>Mohd Azril Dollah</dc:creator>
      <dc:date>2007-03-08T00:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for user password while running a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957832#M95007</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.orafaq.com/forum/t/37241/0/" target="_blank"&gt;http://www.orafaq.com/forum/t/37241/0/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.adp-gmbh.ch/ora/misc/read_sql_from_shell_script.html" target="_blank"&gt;http://www.adp-gmbh.ch/ora/misc/read_sql_from_shell_script.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.dbasupport.com/forums/archive/index.php/t-8424.html" target="_blank"&gt;http://www.dbasupport.com/forums/archive/index.php/t-8424.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.unix.com/showthread.php?t=17437" target="_blank"&gt;http://www.unix.com/showthread.php?t=17437&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 08 Mar 2007 00:47:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957832#M95007</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-03-08T00:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for user password while running a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957833#M95008</link>
      <description>Why do you even need to su ? Are you not executing the script as user "oracle" ?</description>
      <pubDate>Thu, 08 Mar 2007 11:53:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957833#M95008</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2007-03-08T11:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for user password while running a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957834#M95009</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Who will be executing this script?&lt;BR /&gt;&lt;BR /&gt;If root is running it then you don't need a password. If a non-root user is running the script then one of the option is to to setup sudo.</description>
      <pubDate>Thu, 08 Mar 2007 12:44:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957834#M95009</guid>
      <dc:creator>linuxfan</dc:creator>
      <dc:date>2007-03-08T12:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for user password while running a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957835#M95010</link>
      <description>the script run by user root. but the command is only applicable for user oracle. How to use sudo?</description>
      <pubDate>Thu, 08 Mar 2007 20:23:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957835#M95010</guid>
      <dc:creator>Mohd Azril Dollah</dc:creator>
      <dc:date>2007-03-08T20:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Asking for user password while running a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957836#M95011</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Firstly OS password cannot be embedded in scripts,&lt;BR /&gt;Also if oracle user is (which I assume as oracle software owner and oracle db release &amp;gt;= 9i) script owner, then no&lt;BR /&gt;need to provide sys/syspasswd&lt;BR /&gt;&lt;BR /&gt;U can do like this,&lt;BR /&gt;&lt;BR /&gt;login as oracle&lt;BR /&gt;&lt;BR /&gt;create ur script say Start_db_lsnr.sh as&lt;BR /&gt;&lt;BR /&gt;!# /usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;export ORACLE_HOME=/cramerapps/oracleAS&lt;BR /&gt;export ORACLE_SID=asdb&lt;BR /&gt;$ORACLE_HOME/bin/lsnrctl start&lt;BR /&gt;$ORACLE_HOME/bin/sqlplus "/as sysdba" &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;startup&lt;BR /&gt;exit&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;if root is invoking this script then use&lt;BR /&gt;&lt;BR /&gt;# su - oracle -c &lt;UR_SCRIPTS_FULL_PATH&gt;&lt;BR /&gt;&lt;BR /&gt;for any other user use sudo to give access for this script to&lt;BR /&gt;other users&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Sysadmin/sudo-1.6.8p12/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Sysadmin/sudo-1.6.8p12/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for this u have to configure /etc/sudoers using visudo command as root&lt;BR /&gt;&lt;BR /&gt;# visudo&lt;BR /&gt;&lt;BR /&gt;..&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;&lt;USER_NAME&gt; &lt;HOSTNAME&gt; = (oracle) NOPASSWD: &lt;UR_SCRIPTS_FULL_PATH&gt;&lt;BR /&gt;..&lt;BR /&gt;..&lt;BR /&gt;&lt;BR /&gt;save and exit&lt;BR /&gt;&lt;BR /&gt;now login as &lt;USER_NAME&gt; and execute as&lt;BR /&gt;&lt;BR /&gt;sudo &lt;UR_SCRIPTS_FULL_PATH&gt;&lt;BR /&gt;&lt;BR /&gt;- Santosh&lt;/UR_SCRIPTS_FULL_PATH&gt;&lt;/USER_NAME&gt;&lt;/UR_SCRIPTS_FULL_PATH&gt;&lt;/HOSTNAME&gt;&lt;/USER_NAME&gt;&lt;/UR_SCRIPTS_FULL_PATH&gt;</description>
      <pubDate>Fri, 09 Mar 2007 02:38:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/asking-for-user-password-while-running-a-script/m-p/3957836#M95011</guid>
      <dc:creator>SANTOSH S. MHASKAR</dc:creator>
      <dc:date>2007-03-09T02:38:31Z</dc:date>
    </item>
  </channel>
</rss>

