2

I wanted to use ssh in order to connect with localhost but it was impossible. When I wrote

ssh marian@127.0.0.1 -p 22

it display

ssh: connect to host 127.0.0.1 port 22: Connection refused

I want to check ssh status but I have fallowing error:

status error

I thought that problem can be with dependencies so I put

apt-get install -f

but I have this same problem

Failed to start OpenBSD Secure Shell server.

What is wrong?

@edit

sudo /usr/sbin/sshd -ddd

display this:

debug2: load_server_config: filename /etc/ssh/sshd_config
debug2: load_server_config: done config len = 736
debug2: parse_server_config: config /etc/ssh/sshd_config len 736
debug3: /etc/ssh/sshd_config:5 setting Port 22
debug3: /etc/ssh/sshd_config:9 setting Protocol 2
debug3: /etc/ssh/sshd_config:11 setting HostKey /etc/ssh/ssh_host_rsa_key
debug3: /etc/ssh/sshd_config:12 setting HostKey /etc/ssh/ssh_host_dsa_key
debug3: /etc/ssh/sshd_config:13 setting HostKey /etc/ssh/ssh_host_ecdsa_key
debug3: /etc/ssh/sshd_config:14 setting HostKey /etc/ssh/ssh_host_ed25519_key
debug3: /etc/ssh/sshd_config:16 setting UsePrivilegeSeparation yes
debug3: /etc/ssh/sshd_config:19 setting KeyRegenerationInterval 3600
debug3: /etc/ssh/sshd_config:20 setting ServerKeyBits 1024
debug3: /etc/ssh/sshd_config:23 setting SyslogFacility AUTH
debug3: /etc/ssh/sshd_config:24 setting LogLevel INFO
debug3: /etc/ssh/sshd_config:27 setting LoginGraceTime 120
debug3: /etc/ssh/sshd_config:28 setting PermitRootLogin prohibit-password
debug3: /etc/ssh/sshd_config:29 setting StrictModes yes
debug3: /etc/ssh/sshd_config:31 setting RSAAuthentication yes
debug3: /etc/ssh/sshd_config:32 setting PubkeyAuthentication yes
debug3: /etc/ssh/sshd_config:36 setting IgnoreRhosts yes
debug3: /etc/ssh/sshd_config:38 setting RhostsRSAAuthentication no
debug3: /etc/ssh/sshd_config:40 setting HostbasedAuthentication no
debug3: /etc/ssh/sshd_config:45 setting PermitEmptyPasswords no
debug3: /etc/ssh/sshd_config:49 setting ChallengeResponseAuthentication no
debug3: /etc/ssh/sshd_config:64 setting X11Forwarding yes
debug3: /etc/ssh/sshd_config:65 setting X11DisplayOffset 10
debug3: /etc/ssh/sshd_config:66 setting PrintMotd no
debug3: /etc/ssh/sshd_config:67 setting PrintLastLog yes
debug3: /etc/ssh/sshd_config:68 setting TCPKeepAlive yes
debug3: /etc/ssh/sshd_config:75 setting AcceptEnv LANG LC_*
debug3: /etc/ssh/sshd_config:77 setting Subsystem sftp /usr/lib/openssh/sftp-server
debug3: /etc/ssh/sshd_config:88 setting UsePAM yes
debug1: sshd version OpenSSH_7.2, OpenSSL 1.0.2g  1 Mar 2016
debug1: private host key #0: ssh-rsa SHA256:Lsdpgb64ws0fMhktyreuRoq6sD8iFlBdO9LJ7ple8q0
debug1: private host key #1: ssh-dss SHA256:2HpCxTOIMYTen4ZiFLLCPp78+Vj7FsTydWVKQh6ua8k
debug1: private host key #2: ecdsa-sha2-nistp256 SHA256:0EAGTBAznkE2MuCv+EhNbZup091NrQ4u0Cgi3SeEZBY
debug1: private host key #3: ssh-ed25519 SHA256:54l55EUylmXVbaRFtUOijzhEocqmk+N6RihbIer7vRo
Missing privilege separation directory: /var/run/sshd

1 Answers1

2

The best solution is to delete the previously installed ssh server/client

sudo apt-get remove openssh-server openssh-client --purge && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get update

and then install new clean pure ones:

sudo apt-get install openssh-server openssh-client
htaccess
  • 1,428
Dorra B
  • 21