Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Hiding the server password from the command line

7 posts in Windows NT Last posting was on 1997-10-31 09:59:40.0Z
Shalini_Carvalho Posted on 1997-09-12 17:33:02.0Z
Message-ID: <34197CCE.5A27@loyalty.com>
Date: Fri, 12 Sep 1997 13:33:02 -0400
From: Shalini_Carvalho@loyalty.com
X-Mailer: Mozilla 3.0Gold (WinNT; I)
MIME-Version: 1.0
Subject: Hiding the server password from the command line
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 14
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.sqlserver.nt:5535
Article PK: 1081612

Hi

I have several scripts that are scheduled to run in the night. I have
scheduled these using the DOS 'at' command and the windows schedule
service.
The problem is that I have to type in the entire isql command line

isql -Sserver -Usa -Ppassword -iscript.

The problem is the password is seen by anyone who displays a list of
tasks scheduled on the server.

Is there any way I can schedule isql to come up at the required time and
pass to it the password without the password being displayed ?

TIA
shalini


Reinoud van Leeuwen Posted on 1997-10-31 09:59:40.0Z
Message-ID: <3459AC0C.34CF@sybase.com>
Date: Fri, 31 Oct 1997 10:59:40 +0100
From: Reinoud van Leeuwen <reinoud@sybase.com>
Organization: Sybase Inc.
X-Mailer: Mozilla 3.0 (Win95; I)
MIME-Version: 1.0
To: Shalini_Carvalho@loyalty.com
Subject: Re: Hiding the server password from the command line
References: <34197CCE.5A27@loyalty.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 26
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.sqlserver.nt:5443
Article PK: 1081521


Shalini_Carvalho@loyalty.com wrote:
>
> Hi
>
> I have several scripts that are scheduled to run in the night. I have
> scheduled these using the DOS 'at' command and the windows schedule
> service.
> The problem is that I have to type in the entire isql command line
>
> isql -Sserver -Usa -Ppassword -iscript.
>

Yes:
- create two batch files:
1: script.bat looks like:

rem start script1.bat
call c:\scripts\setenv.bat
isql -Usa -P%password% -Sserver -iscript
rem end script1.bat

2: setenv.bat looks like

rem start setenv.bat
set password=myverylongandhopefullyverysecretSybasepassword
rem end setenv.bat

- change the rights for the setenv.bat batch file so that only you and
the
system account (the one that starts the scheduler service) can read
it. In this
way everybody can read an learn from your scripts (if that's what you
want :-)
but nobody can read the sa password.

Reinoud van Leeuwen
Sybase Professional Services - Maarssen / The Netherlands


Himanshu Nagpal Posted on 1997-10-07 18:28:19.0Z
Message-ID: <343A7F43.6FBB@ccmail.muller.com>
Date: Tue, 07 Oct 1997 14:28:19 -0400
From: Himanshu Nagpal <hnagpal@ccmail.muller.com>
Organization: Thomsons Financial Services
X-Mailer: Mozilla 2.0 (X11; I; HP-UX A.09.04 9000/897)
MIME-Version: 1.0
Subject: Re: Hiding the server password from the command line
References: <34197CCE.5A27@loyalty.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 7
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.sqlserver.nt:5484
Article PK: 1081565

Try setting your password to start with a <TAB>. Works on Unix.

for example, set ur password to '<TAB>password'. A list of current
processes will then show the password to be blank. If one <TAB> doesn't
cut it , try using 2 TABs.


David Lance Wolf Posted on 1997-09-13 01:21:42.0Z
Message-ID: <3419EAA6.3B1FAA6@sybase.com>
Date: Fri, 12 Sep 1997 18:21:42 -0700
From: David Lance Wolf <dwolf@sybase.com>
Organization: Sybase Professional Services
X-Mailer: Mozilla 4.02 [en] (Win95; I)
MIME-Version: 1.0
Subject: Re: Hiding the server password from the command line
References: <34197CCE.5A27@loyalty.com>
Content-Type: multipart/mixed; boundary="------------07638EB93D38B1FBA72E8BA9"
Newsgroups: sybase.public.sqlserver.nt
Lines: 47
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.sqlserver.nt:5533
Article PK: 1081611

You can fix this by using a UNIX 'here' file like:

setenv $password "password"
isql -Usa -SServer <<EOF
$password ## Stick the password on this line
`cat my_script_file.sql`
EOF

Check out a UNIX shell book. This is the only real way to hide the
password, since if you just try to place the variable in the -P call,
or even a `cat somefile.txt` Solaris and others will iterpret this on
the fly.

Dave Wolf
Sybase Professional Services

Shalini_Carvalho@loyalty.com wrote:
>
> Hi
>
> I have several scripts that are scheduled to run in the night. I have
> scheduled these using the DOS 'at' command and the windows schedule
> service.
> The problem is that I have to type in the entire isql command line
>
> isql -Sserver -Usa -Ppassword -iscript.
>
> The problem is the password is seen by anyone who displays a list of
> tasks scheduled on the server.
>
> Is there any way I can schedule isql to come up at the required time and
> pass to it the password without the password being displayed ?
>
> TIA
> shalini


Download VCard vcard.vcf


Jim Moriarty Posted on 1997-09-14 20:21:57.0Z
From: "Jim Moriarty" <Jim.Moriarty@ho.tradenz.govt.nz>
Subject: Re: Hiding the server password from the command line
References: <34197CCE.5A27@loyalty.com> <3419EAA6.3B1FAA6@sybase.com>
Organization: Tradenz
Message-ID: <01bcc155$044f7b70$0104010a@moriarty>
X-Newsreader: Microsoft Internet News 4.70.1162
Newsgroups: sybase.public.sqlserver.nt
Date: Sun, 14 Sep 1997 16:21:57 -0400
Lines: 56
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.sqlserver.nt:5529
Article PK: 1081606

Under NT, look at the "start" command to start your batches and use the
title string option.

Eg
start "My Batch Job" isql -Usa -P -Sserver -iscript.sql

The job now shows up as "My Batch Job" under the task manager and the
command prompt title bar is the same.

As you can't use start for an at command (its an internal command and
therefore can't be "run"), you will need to make a command or batch file
that contains these start commands.

Eg c:\temp\batch.cmd contains:
start "My Batch Job" [/WAIT] isql -Usa -P -Sserver -iscript1.sql
start "My Batch Job" [/WAIT] isql -Usa -P -Sserver -iscript2.sql
...

Once this is setup, run your "at" command:
at 12:00 /interactive c:\temp\batch.cmd

Don't forget the /interactive parameter and remember to use the /WAIT
parameter on your start commands if you don't want your scritps to run in
parallel...

Simple ... I think not. Can't wait for the (suggested) VB Script
extensions for the command line in NT 5.0

Jim Moriarty

David Lance Wolf <dwolf@sybase.com> wrote in article
<3419EAA6.3B1FAA6@sybase.com>...
> You can fix this by using a UNIX 'here' file like:
>
> setenv $password "password"
> isql -Usa -SServer <<EOF
> $password ## Stick the password on this line
> `cat my_script_file.sql`
> EOF
>
> Check out a UNIX shell book. This is the only real way to hide the
> password, since if you just try to place the variable in the -P call,
> or even a `cat somefile.txt` Solaris and others will iterpret this on
> the fly.
>
> Dave Wolf
> Sybase Professional Services
>
> Shalini_Carvalho@loyalty.com wrote:
> >
> > Hi
> >
> > I have several scripts that are scheduled to run in the night. I have
> > scheduled these using the DOS 'at' command and the windows schedule
> > service.
> > The problem is that I have to type in the entire isql command line
> >
> > isql -Sserver -Usa -Ppassword -iscript.
> >
> > The problem is the password is seen by anyone who displays a list of
> > tasks scheduled on the server.
> >
> > Is there any way I can schedule isql to come up at the required time
and
> > pass to it the password without the password being displayed ?
> >
> > TIA
> > shalini


Shalini_Carvalho Posted on 1997-09-23 12:10:30.0Z
Message-ID: <3427B1B6.5C9B@loyalty.com>
Date: Tue, 23 Sep 1997 08:10:30 -0400
From: Shalini_Carvalho@loyalty.com
X-Mailer: Mozilla 3.0Gold (WinNT; I)
MIME-Version: 1.0
Subject: Re: Hiding the server password from the command line
References: <34197CCE.5A27@loyalty.com> <3419EAA6.3B1FAA6@sybase.com> <01bcc155$044f7b70$0104010a@moriarty>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 68
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.sqlserver.nt:5514
Article PK: 1081594


Jim Moriarty wrote:
>
> Under NT, look at the "start" command to start your batches and use the
> title string option.
>
> Eg
> start "My Batch Job" isql -Usa -P -Sserver -iscript.sql
>
> The job now shows up as "My Batch Job" under the task manager and the
> command prompt title bar is the same.
>
> As you can't use start for an at command (its an internal command and
> therefore can't be "run"), you will need to make a command or batch file
> that contains these start commands.
>
> Eg c:\temp\batch.cmd contains:
> start "My Batch Job" [/WAIT] isql -Usa -P -Sserver -iscript1.sql
> start "My Batch Job" [/WAIT] isql -Usa -P -Sserver -iscript2.sql
> ...
>
> Once this is setup, run your "at" command:
> at 12:00 /interactive c:\temp\batch.cmd
>
> Don't forget the /interactive parameter and remember to use the /WAIT
> parameter on your start commands if you don't want your scritps to run in
> parallel...
>
> Simple ... I think not. Can't wait for the (suggested) VB Script
> extensions for the command line in NT 5.0
>
> Jim Moriarty
>
> David Lance Wolf <dwolf@sybase.com> wrote in article
> <3419EAA6.3B1FAA6@sybase.com>...
> > You can fix this by using a UNIX 'here' file like:
> >
> > setenv $password "password"
> > isql -Usa -SServer <<EOF
> > $password ## Stick the password on this line
> > `cat my_script_file.sql`
> > EOF
> >
> > Check out a UNIX shell book. This is the only real way to hide the
> > password, since if you just try to place the variable in the -P call,
> > or even a `cat somefile.txt` Solaris and others will iterpret this on
> > the fly.
> >
> > Dave Wolf
> > Sybase Professional Services
> >
> > Shalini_Carvalho@loyalty.com wrote:
> > >
> > > Hi
> > >
> > > I have several scripts that are scheduled to run in the night. I have
> > > scheduled these using the DOS 'at' command and the windows schedule
> > > service.
> > > The problem is that I have to type in the entire isql command line
> > >
> > > isql -Sserver -Usa -Ppassword -iscript.
> > >
> > > The problem is the password is seen by anyone who displays a list of
> > > tasks scheduled on the server.
> > >
> > > Is there any way I can schedule isql to come up at the required time
> and
> > > pass to it the password without the password being displayed ?
> > >
> > > TIA
> > > shalini

I cant use shell scripts as I am running on NT, not UNIX. Also, these
scripts run at about 3 AM when no-one is around. I assume that Jim's
suggestion using /interactive means that the password would need to be
entered on-line. Is there any way I can pipe from a file in NT, without
the password being seen ?
TIA


Jim Moriarty Posted on 1997-09-24 03:04:10.0Z
From: "Jim Moriarty" <Jim.Moriarty@ho.tradenz.govt.nz>
Subject: Re: Hiding the server password from the command line
References: <34197CCE.5A27@loyalty.com> <3419EAA6.3B1FAA6@sybase.com> <01bcc155$044f7b70$0104010a@moriarty> <3427B1B6.5C9B@loyalty.com>
Organization: Tradenz
Message-ID: <01bcc89f$ac03d9a0$1d01de80@moriarty>
X-Newsreader: Microsoft Internet News 4.70.1162
Newsgroups: sybase.public.sqlserver.nt
Date: Tue, 23 Sep 1997 23:04:10 -0400
Lines: 63
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.sqlserver.nt:5510
Article PK: 1081587


Shalini_Carvalho@loyalty.com wrote in article
<3427B1B6.5C9B@loyalty.com>...
> Jim Moriarty wrote:
> >
> > Under NT, look at the "start" command to start your batches and use the
> > title string option.
> >
> > Eg
> > start "My Batch Job" isql -Usa -P -Sserver -iscript.sql
> >
> > The job now shows up as "My Batch Job" under the task manager and the
> > command prompt title bar is the same.
> >
> > As you can't use start for an at command (its an internal command and
> > therefore can't be "run"), you will need to make a command or batch
file
> > that contains these start commands.
> >
> > Eg c:\temp\batch.cmd contains:
> > start "My Batch Job" [/WAIT] isql -Usa -P -Sserver -iscript1.sql
> > start "My Batch Job" [/WAIT] isql -Usa -P -Sserver -iscript2.sql
> > ...
> >
> > Once this is setup, run your "at" command:
> > at 12:00 /interactive c:\temp\batch.cmd
> >
> > Don't forget the /interactive parameter and remember to use the /WAIT
> > parameter on your start commands if you don't want your scritps to run
in
> > parallel...
> >
> > Simple ... I think not. Can't wait for the (suggested) VB Script
> > extensions for the command line in NT 5.0
> >
> > Jim Moriarty
> >

<snip>

> I cant use shell scripts as I am running on NT, not UNIX. Also, these
> scripts run at about 3 AM when no-one is around. I assume that Jim's
> suggestion using /interactive means that the password would need to be
> entered on-line. Is there any way I can pipe from a file in NT, without
> the password being seen ?
> TIA

This being NT, nothing is obvious....

The /interactive parameter simply allows the process to access the
GUI/desktop - after some more testing, you can ignore this parameter. In
fact, this is probably the best option for you - the process does not show
up on the Application List (under NT4.0's Task Manager) and the Process
List only shows that the ISQL program is running - it does not display the
parameters passed to it (eg the password).

So. You need to create a batch file/command file as described in my
previous posting (full of start commands WITH the password included - type
"help start" for more information on the start command) and run the "at"
command without the /interactive parameter.

Obviously people will be able to see the password from the batch file if
you allow them access to it - use NT's file security features to prevent
people from doing this.

Jim