2016-06-05 4 views
-1

Kann nicht ssh in localhost und habe das Gefühl, ich habe alles auf Stackoverflow bereits versucht. Ich habe mit dem ssh_config herumgespielt, um zu versuchen, meine Probleme zu beheben, aber ich bekomme immer noch entweder "Verbindung geschlossen von Remote-Host" oder so etwas wie "Authentifizierungen, die weitermachen können: publickey. Debug1: Keine weiteren Authentifizierungsmethoden zu versuchen" mein Setupsshing in localhost auf Mac (el capitan) ssh_exchange_identification: Verbindung von remote host geschlossen

Hier ist mein, was ich zur Zeit sehe:

$ ssh -v localhost 

OpenSSH_6.9p1, LibreSSL 2.1.8 

debug1: Reading configuration data /Users/<user>/.ssh/config 

debug1: Reading configuration data /etc/ssh/ssh_config 

debug1: /etc/ssh/ssh_config line 20: Applying options for * 

debug1: /etc/ssh/ssh_config line 102: Applying options for * 

debug1: Connecting to localhost [::1] port 22. 

debug1: Connection established. 

debug1: identity file /Users/<user>/.ssh/id_rsa type 1 

debug1: identity file /Users/<user>/.ssh/id_rsa-cert type 5 

debug1: identity file /Users/user/.ssh/id_dsa type 2 

debug1: identity file /Users/user/.ssh/id_dsa-cert type 6 

debug1: identity file /Users/user/.ssh/id_ecdsa type 3 

debug1: identity file /Users/user/.ssh/id_ecdsa-cert type 7 

debug1: identity file /Users/user/.ssh/id_ed25519 type 4 

debug1: identity file /Users/user/.ssh/id_ed25519-cert type 8 

debug1: Enabling compatibility mode for protocol 2.0 

debug1: Local version string SSH-2.0-OpenSSH_6.9 

ssh_exchange_identification: Connection closed by remote host 

meine aktuelle Setup von etc/ssh/ssh_config ist:

This is the ssh client system-wide configuration file. See 
# ssh_config(5) for more information. This file provides defaults for 
# users, and the values can be changed in per-user configuration files 
# or on the command line. 

# Configuration data is parsed as follows: 
# 1. command line options 
# 2. user-specific file 
# 3. system-wide file 
# Any configuration value is only changed the first time it is set. 
# Thus, host-specific definitions should be at the beginning of the 
# configuration file, and defaults at the end. 

# Site-wide defaults for some commonly used options. For a comprehensive 
# list of available options, their meanings and defaults, please see the 
# ssh_config(5) man page. 

Host * 
    SendEnv LANG LC_* 

# Configuration options and default values (see ssh_config(5) for their meaning): 
# 
# Host # (no default) 
# AddressFamily any 
# AskPassGUI yes # (Apple only) 
# BatchMode no 
# BindAddress # (no default) 
# ChallengeResponseAuthentication yes 
# CheckHostIP yes 
# Cipher 3des 
# ClearAllForwardings no 
# Compression no 
# CompressionLevel 6 
# ConnectionAttempts 1 
# ConnectTimeout # (no default) 
# ControlMaster no 
# ControlPath # (no default) 
# ControlPersist no 
# DynamicForward 
# EnableSSHKeysign no 
# EscapeChar ~ 
# ExitOnForwardFailure no 
# ForwardAgent no 
# ForwardX11 no 
# ForwardX11Timeout 1200 
# ForwardX11Trusted no 
# XauthLocation xauth # Default is to search $PATH. It is recommended that a full path be provided. 
# GatewayPorts no 
# GlobalKnownHostsFile /etc/ssh/ssh_known_hosts,/etc/ssh/ssh_known_hosts2 
    GSSAPIAuthentication yes 
    GSSAPIDelegateCredentials yes 
# GSSAPIKeyExchange no 
    GSSAPITrustDNS yes 
# HashKnownHosts no 
# HostbasedAuthentication no 
# HostKeyAlgorithms [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss 
# HostKeyAlias # (no default) 
# HostName # (set by command at run-time) 
# IdentitiesOnly no 
# IdentityFile .ssh/id_rsa,.ssh/id_dsa 
# IPQoS lowdelay 
# KbdInteractiveAuthentication yes 
# KbdInteractiveDevices # (no default) 
# KexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 
# LocalCommand # (no default) 
# LocalForward # (no default) 
# LogLevel INFO 
# NoHostAuthenticationForLocalhost no 
# NumberOfPasswordPrompts 3 
# PasswordAuthentication yes 
# PermitLocalCommand no 
# PKCS11Provider # (no default) 
# Port 22 
# PreferredAuthentications gssapi-with-mic,hostbased,publickey,keyboard-interactive,password # (set by ssh at run-time) 
# Protocol 2 
# ProxyCommand # (no default) 
# PubkeyAuthentication yes 
# RekeyLimit 0 
# RemoteForward # (no default) 
# RequestTTY auto 
# RhostsRSAAuthentication no 
# RSAAuthentication yes 
# SendEnv # (no default) 
# ServerAliveCountMax 3 
# ServerAliveInterval 0 
# StrictHostKeyChecking ask 
# TCPKeepAlive yes 
# Tunnel no 
# TunnelDevice any:any 
# UsePrivilegedPort no 
# User # (set by command at run-time) 
# UserKnownHostsFile ~/.ssh/known_hosts,~/.ssh/known_hosts2 
# VerifyHostKeyDNS no 
# VisualHostKey no 
# XAuthLocationi xauth 

# XAuthLocation added by XQuartz (http://www.xquartz.org) 
Host * 
    XAuthLocation /opt/X11/bin/xauth 

Meine Berechtigungen gut aussehen nach anderen Stack-Überlauf Antworten

 
    -rw-r--r-- 1 root wheel 3953 Jun 4 21:23 ssh_config 
    -rw-r--r-- 1 root wheel 4219 Jun 4 21:32 ssh_config~ 
    -rw-r--r-- 1 root wheel 1624 Jan 21 17:10 ssh_config~orig 
    -rw------- 1 root wheel  668 Feb 26 07:39 ssh_host_dsa_key 
    -rw-r--r-- 1 root wheel  590 Feb 26 07:39 ssh_host_dsa_key.pub 
    -rw------- 1 root wheel  227 May 29 19:20 ssh_host_ecdsa_key 
    -rw-r--r-- 1 root wheel  162 May 29 19:20 ssh_host_ecdsa_key.pub 
    -rw------- 1 root wheel  387 May 29 19:20 ssh_host_ed25519_key 
    -rw-r--r-- 1 root wheel  82 May 29 19:20 ssh_host_ed25519_key.pub 
    -rw------- 1 root wheel  965 Feb 26 07:39 ssh_host_key 
    -rw-r--r-- 1 root wheel  630 Feb 26 07:39 ssh_host_key.pub 
    -rw------- 1 root wheel 1675 Feb 26 07:39 ssh_host_rsa_key 
    -rw-r--r-- 1 root wheel  382 Feb 26 07:39 ssh_host_rsa_key.pub 
    -rw-r--r-- 1 root wheel 4216 Jun 4 21:11 sshd_config 
    -rw-r--r-- 1 root wheel 4215 Jun 4 21:02 sshd_config~ 

Nicht sicher, wo sonst hätte ich schief gehen können-- Jeder Ratschlag, den Sie vorschlagen könnten, würde unglaublich geschätzt werden !!

EDIT: Ich bin jetzt immer

<pre>4 22:30:56 MacBook-Pro com.apple.xpc.launchd[1] (com.openssh.sshd.EEE1E6DD-C42C-45AD-9D7E-8D5C85D4E6C8[1032]): Service exited with abnormal code: 255 

4. Juni 22.31.03 MacBook-Pro com.apple.xpc.launchd [1] (org.openbsd.ssh-agent [1067]): Dienst mit abnormalem Code beendet: 1 Jun 4 22:31:03 MacBook-Pro com.apple.xpc.launchd [1] (org.openbsd.ssh-agent): Der Dienst wurde nur für 0 Sekunden ausgeführt. Die Respawn werden um 10 Sekunden zurückgesetzt. Jun 4 22:31:13 MacBook-Pro com.apple.xpc.launchd [1] (org.openbsd.ssh-agent [1091]): Dienst beendet mit abnormalem Code: 1 Jun 4 22:31:13 MacBook -Pro com.apple.xpc.launchd [1] (org.openbsd.ssh-agent): Der Dienst wurde nur für 0 Sekunden ausgeführt. Die Respawn werden um 10 Sekunden zurückgesetzt.

mein Schlüssel scheint, als zu arbeiten sshing aber hängt an der Linie debug1: SSH2_MSG_SERVICE_ACCEPT

erhielt

wenn ich $ SSH_AUTH_SOCK unset vor dem ssh versucht, alles wie erwartet funktioniert

Antwort

0

Es soll eine Datei „authorized_keys aufgerufen werden ". Sie sollten den eigenen öffentlichen Schlüssel (die Cert-Dateien) hinzufügen (kopieren und einfügen).

+0

Immer noch das Gleiche: ( – tara

+0

Überprüfen Sie die Berechtigungen für die Datei authorized_keys auch. Ich sehe es hier nicht. – ViKiG

+0

-rwx ----- - 1 user owner 3136 Jun 4 21:08 authorized_keys – tara

0

Um anderen zu helfen: Es gibt mehrere SSH-Konfigurationsdateien! ich muss eine million mal über meine ssh-konfiguration gegangen sein, aber ich habe die ganze zeit die falsche datei angesehen. Meine sshd_config hatte einen Fehler darin. Da ich in meine eigene Maschine geschaut habe, mussten beide Dateien korrekt eingerichtet werden. (eine Datei für den Client, eine für die Server-Konfiguration -> das ist zumindest mein derzeitiges Verständnis). cat /var/log/system.log | grep ssh hat darauf hingewiesen, dass der Fehler in der anderen Datei aufgetreten ist. hängt immer noch für mich auf ssh, aber mindestens einen Schritt weiter:)

Verwandte Themen