1826404 Members
4149 Online
109692 Solutions
New Discussion

openssh (scp and sftp)

 
SOLVED
Go to solution
Jairo Campana
Trusted Contributor

openssh (scp and sftp)

hello I need to use scp or sftp automatic without it requests password to me that I must change .
is my configuration of sshd_config(servidor):
Port 24
Protocol 2,1
#ListenAddress 0.0.0.0
#ListenAddress ::
HostKey /opt/openssh2/etc/ssh_host_key
HostKey /opt/openssh2/etc/ssh_host_dsa_key
#HostKey /opt/openssh2/etc/ssh_host_rsa_key
ServerKeyBits 768
LoginGraceTime 600
KeyRegenerationInterval 3600
PermitRootLogin yes
#
# Don't read ~/.rhosts and ~/.shosts files
IgnoreRhosts no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
StrictModes yes
X11Forwarding no
X11DisplayOffset 10
PrintMotd yes
KeepAlive yes
PubkeyAuthentication no
# Logging
SyslogFacility AUTH
LogLevel INFO
#obsoletes QuietMode and FascistLogging
RhostsAuthentication no

# For this to work you will also need host keys in /opt/openssh2/etc/ssh_known_hosts
RhostsRSAAuthentication no
#
RSAAuthentication yes
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
PermitEmptyPasswords no
# Uncomment to disable s/key passwords
#ChallengeResponseAuthentication no
# To change Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#AFSTokenPassing no
#KerberosTicketCleanup no
# Kerberos TGT Passing does only work with the AFS kaserver
#KerberosTgtPassing yes
#CheckMail yes
#UseLogin no


#MaxStartups 10:30:60
#Banner /etc/issue.net
#ReverseMappingCheck yes

Subsystem sftp /opt/openssh2/libexec/sftp-server

*********************************************
is my configuration of ssh_config(cliente):

Host *
# ForwardAgent no
# ForwardX11 no
# RhostsAuthentication no
RhostsRSAAuthentication yes
RSAAuthentication yes
PasswordAuthentication yes
# FallBackToRsh no
# UseRsh no
# BatchMode no
# CheckHostIP yes
# StrictHostKeyChecking yes
IdentityFile /.ssh/identity
# IdentityFile ~/.ssh/id_dsa
# IdentityFile ~/.ssh/id_rsa1
# IdentityFile ~/.ssh/id_rsa2
Port 24
Protocol 1,2
# Cipher blowfish
# EscapeChar ~

legionx
2 REPLIES 2
Santosh Nair_1
Honored Contributor

Re: openssh (scp and sftp)

Basically, you need to set up sshagent so that you don't get prompted for a password/passphrase. Here are two article explaining how:

http://mah.everybody.org/docs/ssh

and

http://www-106.ibm.com/developerworks/linux/library/l-keyc2/?open&l=805,t=grl,p=ossh2

-Santosh
Life is what's happening while you're busy making other plans
Craig Rants
Honored Contributor
Solution

Re: openssh (scp and sftp)

I made a few mod's to your sshd_config your ssh_config should not matter. This is for the simplest type of trusted authentication. You should look at getting O'Reily's SSH book.

Port 24
Protocol 2,1
#ListenAddress 0.0.0.0
#ListenAddress ::
HostKey /opt/openssh2/etc/ssh_host_key
#HostKey /opt/openssh2/etc/ssh_host_dsa_key
#HostKey /opt/openssh2/etc/ssh_host_rsa_key
ServerKeyBits 768
LoginGraceTime 600
KeyRegenerationInterval 3600
PermitRootLogin yes
#
# Don't read ~/.rhosts and ~/.shosts files
IgnoreRhosts no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
StrictModes yes
X11Forwarding no
X11DisplayOffset 10
PrintMotd yes
KeepAlive yes
PubkeyAuthentication no
# Logging
SyslogFacility AUTH
LogLevel INFO
#obsoletes QuietMode and FascistLogging
RhostsAuthentication yes

# For this to work you will also need host keys in /opt/openssh2/etc/ssh_known_hosts
RhostsRSAAuthentication yes
#
RSAAuthentication yes
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
PermitEmptyPasswords no
# Uncomment to disable s/key passwords
#ChallengeResponseAuthentication no
# To change Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#AFSTokenPassing no
#KerberosTicketCleanup no
# Kerberos TGT Passing does only work with the AFS kaserver
#KerberosTgtPassing yes
#CheckMail yes
#UseLogin no


#MaxStartups 10:30:60
#Banner /etc/issue.net
#ReverseMappingCheck yes

Subsystem sftp /opt/openssh2/libexec/sftp-server


In the users .shost file add
hostname username
note: may need hostname(FQDN)

establish the key's both way
then do a ssh -v and watch the output for any errors
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut