Operating System - OpenVMS
1752805 Members
5373 Online
108789 Solutions
New Discussion юеВ

Re: how to hide passwd while copy between server.

 
Hein van den Heuvel
Honored Contributor

Re: how to hide passwd while copy between server.


Shiva,

Wim gave the rigth advice earlier, but you had the single quotes wrong, and you must not have verification in effect: $SET NOVERI.

If somehow you feel you must have verification active, and can not even disable it just around the command, then you have to tell DCL to POSTPONE the symbol substitution until the last moment.
You'll need the FULL filespec in the symbol.

Example using '0' as node name:

$set veri
$pass="secret"
$remote = "0""hein " + pass + """::*.COM;"
$show symb remote
$!REMOTE = "0"hein secret"::*.COM;"
$dir &remote

Logical names are a viable option as pointed out, but where does it get its value string from? How to hide that?
Similar as per above, but we have to throw in even more double quotes... but no longer need the full file spec.

$set veri
$pass="secret"
$remote = "0""""""hein " + pass + """""""::"
$show symb remote
$! REMOTE = "0"""hein secret"""::"
$define remote &remote
$show logical remote
$! "REMOTE" = "0"hein secret"::"
$dir remote:*.com;

:

Yes, that's 6 double quotes after the node name, and 7 before the '::'.

Hein.
Hoff
Honored Contributor

Re: how to hide passwd while copy between server.

Or you can...

UAF> ADD /PROXY [/DEFAULT] [from-spec] [to-spec]

within the UAF on the target host, and you're done. With this, no password is then needed; the specified user on the specified host can access the specified username on the specified remote host.

Or you can get (rather more) serious about system security, and reduce your dependence on (insecure) DECnet and on user-specified text passwords. The available ssh and sftp widgets support no-password logins and various passphrase-based and policy-based logins using public key encryption. Far more secure.

shiva27
Frequent Advisor

Re: how to hide passwd while copy between server.

This is one time job so no need to define proxy account here.
In our work enviornment our session log monitor by review team so what is my requirement is ,without displaying password on session, i want to copy the file between server.
I tried as,
$set term/noecho
$pass=="welcome"
$set term/echo
$copy test.txt remser"shiva pass"::disk:[dir]/log

I experience below error message after executing above cmd,

%COPY-E-OPENOUT, error opening remser"shiva pass"::disk:[dir]/log as output
-RMS-E-CRE, ACP file create failed
-SYSTEM-F-INVLOGIN, login information invalid at remote node %COPY-W-NOTCOPIED.
Karl Rohwedder
Honored Contributor

Re: how to hide passwd while copy between server.

If you want the symbol to get evaluated try:

set term/noecho
$pass=="welcome"
$set term/echo
$copy test.txt remser"shiva ''pass'"::disk:[dir]/log

(these are single quotes around PASS).

regards Kalle
Steven Schweda
Honored Contributor

Re: how to hide passwd while copy between server.

> If you want the symbol to get evaluated try:
> [...]

You know, like this:

node2"account ''tt'"::

(Jan 6, 2009 05:25:59 GMT)
John Gillings
Honored Contributor

Re: how to hide passwd while copy between server.

shiva,

>In our work enviornment our session log
>monitor by review team so what is my
>requirement is ,without displaying
>password on session, i want to copy the
>file between server.

Now that we understand the real issue, it's possible to post a solution.

Here's a short command procedure that will define a logical name containing an access control string, prompting for the password with no echo. You can then use the logical name for your remote access. The password won't be displayed on the screen, or in the session log. You may wish to DEASSIGN the logical name after use for some semblence of security.

DEFINE_ACCESS.COM
$ logname=p1
$ node=p2
$ user=p3
$ pass=p4
$ IF logname.EQS."" THEN READ/PROMPT="Logical name: " SYS$COMMAND logname
$ IF logname.EQS."" THEN EXIT
$ IF node.EQS."" THEN READ/PROMPT="Node: " SYS$COMMAND node
$ IF node.EQS."" THEN node="0"
$ IF user.EQS."" THEN READ/PROMPT="Username: " SYS$COMMAND user
$ IF user.EQS."" THEN user=F$GETJPI("","USERNAME")
$ IF pass.EQS.""
$ THEN
$ SET NOON
$ SET TERMINAL/NOECHO
$ READ/PROMPT="Password: " SYS$COMMAND pass
$ SET TERMINAL/ECHO
$ ENDIF
$ DEFINE/NOLOG 'logname' "''node'""''user' ''pass'""::"

(unfortunately there's no easy way in DCL to do a nice, modular, error proof no-echo prompt)

I've also attached it as a text file, in case your browser breaks the inline text.

To use the procedure, give it a logical name, node name and username. It will prompt for any missing parameters. The password is prompted with no echo.

For example:

$ @DEFINE_ACCESS REMNODE NODE2 SHIVA
Password: (enter password, not echoed)
$ COPY a.txt REMNODE::disk:[dir]
$ DEASSIGN REMNODE

Note for the sharp eyed... although the logical name already contains a "::" node delimiter, it's necessary to use "::" in the file specification to allow a device and directory to be included in the file specification. You could say:

$ COPY a.txt REMNODE:b.txt

to copy the file into the default directory for the target user, but if you want to include a device and directory specification you need "::".


I thought the RCP command would prompt for a password if you said:

$ RCP/USER=user/PASS a.txt node2:

(ie, without specifying a password on the command line), but it doesn't. Maybe it was SSH?
A crucible of informative mistakes
shiva27
Frequent Advisor

Re: how to hide passwd while copy between server.

Failed below cmd,

$tt=="welcome"
$sh sym tt
TT == "welcome"
$copy a.txt node2"shive ''tt''"::disk:[dir]
-SYSTEM-F-INVLOGIN, login information invalid at remote node

$copy a.txt node2"shive "tt""::disk:[dir]
%DCL-W-INVNOD, invalid node name specification; respecify \node2"shive "TT""::\

Am i doing any mistake here.. please suggest.
Karl Rohwedder
Honored Contributor

Re: how to hide passwd while copy between server.

Shiva27,

I think you put 2 quotes before and after the TT symbol, it's 2 before and one after, so

"user ' ' pass ' "

These are the 'normal' DCL substitution rules.

regards Kalle
shiva27
Frequent Advisor

Re: how to hide passwd while copy between server.

Thanks Karl and All,

it's thru.I'm able to copy now. :)
Kumar_Sanjay
Regular Advisor

Re: how to hide passwd while copy between server.

You enable to opcom Message in 2nd node...you will able to get clear error..

cheers...