LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-20-2009, 08:06 AM   #1
Ghostwheel
LQ Newbie
 
Registered: Jun 2004
Location: Mid Michigan
Distribution: CentOS
Posts: 28

Rep: Reputation: 0
SSH autologin FreeBSD -> CentOS5


I am trying to set up a script that will copy files from a CentOS5.x server to a FreeBSD server (well, the BSD pulls the files to itself). I have set up a few BSD->BSD servers with this config already so I'm not asking how I do it, it just isn't working from the BSD server to the CentOS server. When I try to log in it asks for a password.

I've been beating my head on something that should be dead simple for about a day now. Help please!

sshd_config from CentOS
Code:
#  $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk 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
Protocol 2
#AddressFamily any
#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

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

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

# Authentication:

LoginGraceTime 30
PermitRootLogin no
#StrictModes yes
MaxAuthTries 3

#RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys

# 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
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

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

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

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
#UsePAM no
UsePAM yes

# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no

# no default banner path
#Banner /some/path

# override default of no subsystems
Subsystem       sftp    /usr/libexec/openssh/sftp-server
 
Old 03-21-2009, 06:14 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by Ghostwheel View Post
When I try to log in it asks for a password.
So I gather you are trying to log in with a key? If so, the server is very particular about the permissions for the authorized_keys file. If that file or anything in its path (including /home/user or /home/user/.ssh) is writable by group or world then the server will refuse to auththenticate with that file, which could be where the password prompt is comming from.
 
Old 03-23-2009, 02:31 PM   #3
Ghostwheel
LQ Newbie
 
Registered: Jun 2004
Location: Mid Michigan
Distribution: CentOS
Posts: 28

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by blackhole54 View Post
So I gather you are trying to log in with a key? If so, the server is very particular about the permissions for the authorized_keys file. If that file or anything in its path (including /home/user or /home/user/.ssh) is writable by group or world then the server will refuse to auththenticate with that file, which could be where the password prompt is comming from.
/home/user is 700, /home/user/.ssh is 600
 
Old 03-23-2009, 02:36 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Check /var/log/secure on the CentOS (sshd server) side. It may provide clues about why pubkey authentication is not taking.
 
Old 03-23-2009, 02:47 PM   #5
Ghostwheel
LQ Newbie
 
Registered: Jun 2004
Location: Mid Michigan
Distribution: CentOS
Posts: 28

Original Poster
Rep: Reputation: 0
Ok, found out that was wrong. Reset my home directory to 755 and it works like a charm!
 
Old 03-24-2009, 12:26 AM   #6
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by Ghostwheel View Post
Reset my home directory to 755 and it works like a charm!
Interesting! I don't understand why the additional permissions (x55) would be required But, as long as you got it working ...

For the record, I just tried and public key authentication did not work when I set /home/user/.ssh to 600, but does work when set to 700 (where it has always been).
 
Old 03-24-2009, 11:51 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by blackhole54
For the record, I just tried and public key authentication did not work when I set /home/user/.ssh to 600, but does work when set to 700 (where it has always been).
Good catch -- I missed that at first read. His latest 755 permissions are not necessary at the home directory level or at the ~/.ssh level. He could have just changed ~/.ssh to 700.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make passwordless-ness for ssh in centos5.2 santosh.chini Linux - Server 4 03-15-2009 12:01 PM
SSH/SCP Autologin overpeer Linux - Security 8 10-19-2005 06:51 AM
Autologin to KDE from SSH skorpi0wn Linux - Software 1 04-18-2005 11:22 PM
SSH and autologin? presstone Linux - General 8 03-12-2003 08:40 PM


All times are GMT -5. The time now is 11:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration