Operating System - Linux
1829091 Members
2713 Online
109986 Solutions
New Discussion

scp with out password request Linux 2.4.21-20.EL

 
SOLVED
Go to solution
WilliamSmith11
Super Advisor

scp with out password request Linux 2.4.21-20.EL

Hi some body have succefully done some script to do a remote copy using scp Enterprise Linux 2.4.21-20.EL.

I have try with all this link and nothing

http://www.linuxgazette.com/node/193
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=805131
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=112337

Some other idea?

W.S





rperez
11 REPLIES 11
paolo barila
Valued Contributor

Re: scp with out password request Linux 2.4.21-20.EL

Hi,
you can configure a publickey authentication with a null passphrase:

login IDA@SERVER1

SERVER1# ssh-keygen -t rsa -C "ssh_for_`whoami`@`hostname`" -f ~/.ssh/id_rsa
empty for no passphrase



SERVER1# cp -p id_rsa.pub authorized_keys.SERVER1
SERVER1# chmod 600 auth*
SERVER1# scp -p authorized_keys.SERVER1 SERVER2:/$PWD


login IDB@SERVER2

SERVER2# cat authorized_keys.SERVER1 >> authorized_keys
SERVER2# chmod 600 authorized_keys

IDA@SERVER1

SERVER1# ssh IDB@SERVER2
yes

(and viceversa)

Pablo
share share share
WilliamSmith11
Super Advisor

Re: scp with out password request Linux 2.4.21-20.EL

Here is an attachment about my commands and results.

Please may somebody helpme

Linux is not my daily OS but I am trying



W.S
rperez
WilliamSmith11
Super Advisor

Re: scp with out password request Linux 2.4.21-20.EL

HPUX is my node1 called hprp5430.
Linux is my node2 called denver

I am playing with this to node before going to do the real test in the two linux nodes.


Thank you again .






W.S
rperez
paolo barila
Valued Contributor

Re: scp with out password request Linux 2.4.21-20.EL

Hi,
try ssh from hp to linux since your set up is for that connection,
the do the same viceversa
share share share
WilliamSmith11
Super Advisor

Re: scp with out password request Linux 2.4.21-20.EL

# uname
HP-UX
# ssh denver
root@denver's password:
Last login: Fri Feb 17 11:49:20 2006
[root@denver root]# exit
logout

Connection to denver closed.
# ssh root@denver
root@denver's password:
Last login: Fri Feb 17 12:05:54 2006 from hprp5430
[root@denver root]#

Is requestion for password .

rperez
paolo barila
Valued Contributor

Re: scp with out password request Linux 2.4.21-20.EL

check permission:

$HOME = 755
.ssh = 700
authorized_keys = 600

check config:

# vi /etc/ssh/sshd_config
PubkeyAuthentication yes
share share share
WilliamSmith11
Super Advisor

Re: scp with out password request Linux 2.4.21-20.EL

[root@denver root]# more out.txt
# $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.

#Port 22
#Protocol 2,1
#ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 3600
#ServerKeyBits 768

# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 120
#PermitRootLogin yes
#StrictModes yes

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys

# rhosts authentication should not be used
# rhosts authentication should not be used
#RhostsAuthentication no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
--More--(72%)
#KerberosTicketCleanup yes

#AFSTokenPassing no

# Kerberos TGT Passing only works with the AFS kaserver
#KerberosTgtPassing no

# Set this to 'yes' to enable PAM keyboard-interactive authentication
# Warning: enabling this may bypass the setting of 'PasswordAuthentication'
#PAMAuthenticationViaKbdInt no

#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#KeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes

# Warning: enabling this may bypass the setting of 'PasswordAuthentication'
#PAMAuthenticationViaKbdInt no

#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#KeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes

#MaxStartups 10
# no default banner path
#Banner /some/path
#VerifyReverseMapping no
#ShowPatchLevel no

# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
[root@denver root]#


These parameters are ok to the scp

#PasswordAuthentication yes
#PermitEmptyPasswords no

rperez
Geoff Wild
Honored Contributor

Re: scp with out password request Linux 2.4.21-20.EL

This is how I did it on fedora:

http://www.cvrti.utah.edu/~dustman/no-more-pw-ssh/

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
WilliamSmith11
Super Advisor

Re: scp with out password request Linux 2.4.21-20.EL

everything is working fine till

the line

source $ssh_info_file

# ssh-agent >ssh_info_file
# chmod 600 ssh_info_file
# source ssh_info_file
sh: source: not found.
# ssh-add ~/.ssh/identity
Could not open a connection to your authentication agent.



ssh_info_file=~/.ssh-agent-info-`hostname`
ssh-agent >$ssh_info_file
chmod 600 $ssh_info_file
source $ssh_info_file
ssh-add ~/.ssh/identity
ssh-add ~/.ssh/id_dsa
ssh-add ~/.ssh/id_rsa

really this have been a heavy lalor!



rperez
Geoff Wild
Honored Contributor
Solution

Re: scp with out password request Linux 2.4.21-20.EL

Are you using bash?

source is a built in command...

If not, try

. ./ssh_info_file



I do mine like so:

#!/bin/bash
# Creates an ssh-agent, writes ssh agent info
# to the file '~/.ssh-agent-info-`hostname`' and then prompts
# user for keys. Then any shell can use the agent
# by sourcing the contents of ~/.ssh-agent-info-`hostname`:
# . ~/ssh-agent-info-`hostname`
#set -x
ssh_info_file=~/.ssh-agent-info-`hostname`
ssh-agent >$ssh_info_file
chmod 600 $ssh_info_file
source $ssh_info_file
for i in identity id_dsa id_rsa
do
ssh-add .ssh/$i
done
echo "Don't forget to 'source $ssh_info_file'"


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
WilliamSmith11
Super Advisor

Re: scp with out password request Linux 2.4.21-20.EL

Thank you everybody for the help .

Thank you Geoff,

It was magic when I do the scp and does not request for passwowd .

reallly this case was difficult for me .
but finally with the help of every body , the problem was solved ,

W;S
rperez