Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scp in aix 2

Status
Not open for further replies.

tech005

MIS
Dec 11, 2003
36
0
0
US
I'm trying to create a script with scp command to put it in cron for copying files between two nodes. When i run the command it stops asking for password.I tried the -B option with scp and it didn't work. Any one have any idea..Thanks in advance
 
You have to have some sort of other authentication mechanism in place already (like public key, etc...). When you try to scp from command line are you prompted for a password?

Jim Hirschauer
 
Yes, i thought the -B option won't ask me for the password.
 
You need to set up ssh keys between the hosts that are allowed/need to talk to each other without a password.

Refer to the "Automating logins with openssh" section of this doc:


While the doc does refer to "ssh", it works for scp too, once the keys are in place.

Of course, if you are using commercial versions of ssh, be sure to follow the appropriate section.

scott
 
To user scp "like" rmcd

vi /etc/ssh/ssh_config
>HostbasedAuthentication yes
>EnableSSHKeysign yes

vi /etc/ssh/sshd_config
> HostbasedAuthentication yes
> IgnoreRhosts no

stopsrc -s sshd
startsrc -s sshd

vi .shosts
>> hostname login
 
Scott,
I was able to configure SSH with the doc "Automating logins with openssh" on my test system amd i was able to copy files between nodes using 'scp'and evrything working fine, but when i was doing the same for my production system it is giving me error for the 'scp' command.

scp -pr /userapps/niku/clarity/filestore/* clarpxapp02:/userapps/niku/clarity/filestore
The authenticity of host 'clarpxapp02 (192.168.76.35)' can't be established.
RSA key fingerprint is f0:6d:12:13:37:e2:f9:44:d8:3e:53:df:b7:17:a5:c2.
Are you sure you want to continue connecting (yes/no)?

Any thoughts??
 
Tech005

One of the gotchas to watch out for when setting up automated scp and/or ssh jobs is to make sure that you have previously connected to all systems involved and accepted the host keys for it.

In your example above, its basically saying "I dont know this system - yet". Interactively scp or ssh to "clarpxapp02" and when prompted to continue connecting, type yes. After that, unless the key for that system somehow changes, it wont ask anymore.

You should always connect manually first time to all hosts involved to accept the keys. Once that is done, you can then set up the keys for automated jobs.

scott
 
Scott,
But it's asking for the user's password each time i do the 'scp' command. Something wierd happening.It was very smoothe when i set it up on my test systems.Does it have anything to do with the sshd deamon.I tried refreshing the deamon.
 
Are permissions, etc, set correctly on the files and directories?

What are the details of the systems? IE what version of AIX? what account(s) are being used? What version of SSH is in use (is it consistant across the systems)? Include any other details that may help.

scott
 
I checked the permission and everything looks right.AIX5.2 ML 7 across the nodes and ssh version is OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004 across the nodes.
This is what's happening


clarpxapp01:/userapps/niku/clarity/.ssh >ssh clarpxapp02
nikuser@clarpxapp02's password:

It doesn't prompt me for the password on the test systems.
 
check the account settings for nikuser - see if logins/rlogins are set to false. I have seen instances where one (or both) being set to false will cause a password prompt to be displayed.

If one (or both) are set to false, try changing them to true and test again - see if that resolves being prompted for the password.

scott
 
nikuser is set to 'true' for logins/rlogins on both systems.
 
Scott,
It's fixed. It was a file permission issue.Thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top