Link to home
Start Free TrialLog in
Avatar of sunhux
sunhux

asked on

Expect & sshpass package for Solaris 10 x86

It's not an option to do keys-exchange for scp/ssh in our environment & it
has to be password-authenticated.

For Linux, there's sshpass.

Q1:
For Solaris, I have to use expect script or is there another solution to pass
password to scp?  I refer to:
http://stackoverflow.com/questions/50096/how-to-pass-password-to-scp

Q2:
Where can I download the full expect pkg for Solaris 10 x86  (32 bit) with
all its pre-requisites?  So far, I only manage to find for Sparc:
http://unix.ittoolbox.com/groups/technical-functional/solaris-l/expect-package-on-sun-solaris-10-4246947
https://www.opencsw.org/package/expect/

Q3:
Can Perl script do such password passing to scp?  If so, appreciate if
anyone provide such a script, then don't even need to consider expect
or TCL as I will need approval to install these freeware


If I need Oracle subscription to login to the official site to download any of
the packages, let me know the actual URL to get expect & its pre-requisite
packages.  I have an account
Avatar of sunhux
sunhux

ASKER

After checking in Oracle's community responses, the Solaris "scp --password" option does not
appear to help relay the password to scp.  But can anyone tell me how to insert this password
in ssh_config :

 
1.
i kept my pass on first line of file pass_file
[lily]DMSPIMG
/opt/oracle/work/dilip> scp t.sh xpu791@yara:/oracle/data_01 --password=file:pass_file
error: could not connect to `--password=file'
 
2.
 
[lily]DMSPIMG
/opt/oracle/work/dilip> scp t.sh xpu791@yara:/oracle/data_01 --password=abcd1234
error: destination (/opt/oracle/work/dilip/--password=abcd1234) is not a directory.

Did I miss something?

===================================================================================

After reviewing the man page for scp and ssh on AIX I would say you have gotten no answer to item 1 because scp does not support a command line password option.  However by using the batch, -B, option scp will suppress prompting for a password and expects the password to be present in the user ssh config file.  Exactly how you enter said password I am not sure though I did see one parameter that ended with the password while reviewing the ssh_config entry.
Avatar of sunhux

ASKER

I don't have access to a Solaris server for the next few days so need someone to test it
out on a Solaris 10 x86 if the following works:

yes ssh_password | scp user@server:/path/file  my_local_dir/
Avatar of sunhux

ASKER

The following is to pass password to sudo but I recall I ever tried it for scp & it doesn't work:
Yes, use the -S switch which reads the password from STDIN:

$echo <password> | sudo -S <command>
So for your case it would look like this:

$./configure && make && echo <password> | sudo -S make install && halt
SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of btan
btan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sunhux

ASKER

The 2 links btan gave do not appear to mention anything
about passing a password to scp, or do they?

I'm attempting to implement the following but if I can't
get an Expect/Tcl package for Solaris x86, would it work
if I set the password to null as that's a readonly account?
(haven't got a chance to go back to office to try setting
 this readonly account's password to null)

http://stackoverflow.com/questions/50096/how-to-pass-password-to-scp
SSH does key exchange before passwords, so you are completely out of luck....
Avatar of sunhux

ASKER

So does this mean even if I set the password to null, it will still prompt for
password & I'll still need to hit the <ENTER> key (to send a null password)
before the scp could go through?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Option to set password in command line was removed from OpenSSH like in year 2000 or so. I think it still lives in putty plink.exe
Need to also make sure configuration file
- "PasswordAuthentication yes" for SSH1 and OpenSSH
- "AllowedAuthentications password" for SSH2)
- Not set to "PermitEmptyPasswords yes".
Also should be able to change the passphrase for a key without regenerating the key
e.g. For ssh-keygen in SSH1 and OpenSSH, use the -N option,
e.g. For ssh-keygen2, use the -p option.
Avatar of sunhux

ASKER

With that number of servers (500+) & we only have till this Monday,
we can't gen the keys in time.

Last question which I still missing the point:
Does this mean even if I set the password to null at the ssh server, the scp
command will still prompt for password & I'll still need to hit the <ENTER>
key (to send a null password) before the scp could go through?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial