Results 1 to 3 of 3
  1. #1
    SSH not listening to SSH port

    Member Since
    Jul 13, 2012
    Posts
    4
    SSH not listening to SSH port
    When I try to access the server remotely, it's giving me with an error:
    ssh_exchange_identification: Connection closed by remote host

    The firewall on Mac is disabled and all the traffic are allowed on my router to access the Mac from public IP. I'm using a custom port 52458 to connect to SSH on Mac and I can telnet to it locally and remotely. When I run telnet localhost 52458, it works but when I run netstat -an | grep ssh or netstat -an | grep 52458 it's not returning any values. I tried running netstat -l to view all listeners but SSH is not listed. The way I edited SSH port is by editing /etc/services and replacing ssh port 22 to 52458. Here is the report of ssh -vv -p52458 admin@localhost
    ssh -vv -p52458 admin@localhost
    OpenSSH_5.1p1, OpenSSL 0.9.7l 28 Sep 2006
    debug1: Reading configuration data /etc/ssh_config
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to localhost [::1] port 52458.
    debug1: Connection established.
    debug1: permanently_set_uid: 0/0
    debug1: identity file /var/root/.ssh/identity type -1
    debug1: identity file /var/root/.ssh/id_rsa type -1
    debug1: identity file /var/root/.ssh/id_dsa type -1
    debug1: Remote protocol version 1.99, remote software version OpenSSH_5.1
    debug1: match: OpenSSH_5.1 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_5.1
    debug2: fd 4 setting O_NONBLOCK
    debug1: An invalid name was supplied
    Configuration file does not specify default realm

    debug1: An invalid name was supplied
    Configuration file does not specify default realm

    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit:
    diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit:
    aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit:
    aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit:
    hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit:
    hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: kex_parse_kexinit:
    diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit:
    aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit:
    aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit:
    hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit:
    hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: mac_setup: found hmac-md5
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug2: mac_setup: found hmac-md5
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
    debug2: dh_gen_key: priv key bits set: 130/256
    debug2: bits set: 530/1024
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    debug1: Host '[localhost]:52458' is known and matches the RSA host key.
    debug1: Found key in /var/root/.ssh/known_hosts:7
    debug2: bits set: 532/1024
    debug1: ssh_rsa_verify: signature correct
    debug2: kex_derive_keys
    debug2: set_newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug2: set_newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug2: key: /var/root/.ssh/identity (0x0)
    debug2: key: /var/root/.ssh/id_rsa (0x0)
    debug2: key: /var/root/.ssh/id_dsa (0x0)
    debug1: Authentications that can continue:
    publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
    debug1: Next authentication method: gssapi-keyex
    debug1: No valid Key exchange context
    debug2: we did not send a packet, disable method
    debug1: Next authentication method: gssapi-with-mic
    debug1: An invalid name was supplied
    Configuration file does not specify default realm

    debug1: An invalid name was supplied
    Configuration file does not specify default realm

    debug2: we did not send a packet, disable method
    debug1: Next authentication method: publickey
    debug1: Trying private key: /var/root/.ssh/identity
    debug1: Trying private key: /var/root/.ssh/id_rsa
    debug1: Trying private key: /var/root/.ssh/id_dsa
    debug2: we did not send a packet, disable method
    debug1: Next authentication method: keyboard-interactive
    debug2: userauth_kbdint
    debug2: we sent a keyboard-interactive packet, wait for reply
    debug2: input_userauth_info_req
    debug2: input_userauth_info_req: num_prompts 1
    Password:
    debug2: input_userauth_info_req
    debug2: input_userauth_info_req: num_prompts 0
    debug1: Authentication succeeded (keyboard-interactive).
    debug1: channel 0: new [client-session]
    debug2: channel 0: send open
    debug1: Requesting no-more-sessions@openssh.com
    debug1: Entering interactive session.
    debug2: callback start
    debug2: client_session2_setup: id 0
    debug2: channel 0: request pty-req confirm 1
    debug2: channel 0: request shell confirm 1
    debug2: fd 4 setting TCP_NODELAY
    debug2: callback done
    debug2: channel 0: open confirm rwindow 0 rmax 32768
    debug2: channel_input_confirm: type 99 id 0
    debug2: PTY allocation request accepted on channel 0
    debug2: channel 0: rcvd adjust 2097152
    debug2: channel_input_confirm: type 99 id 0
    debug2: shell request accepted on channel 0
    Last login: Thu Jan 3 15:29:33 2013
    Welcome to Darwin!
    admins-mac-mini:~ admin$ exit
    logout
    debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
    debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
    debug2: channel 0: rcvd eow
    debug2: channel 0: close_read
    debug2: channel 0: input open -> closed
    debug2: channel 0: rcvd eof
    debug2: channel 0: output open -> drain
    debug2: channel 0: obuf empty
    debug2: channel 0: close_write
    debug2: channel 0: output drain -> closed
    debug2: channel 0: rcvd close
    debug2: channel 0: almost dead
    debug2: channel 0: gc: notify user
    debug2: channel 0: gc: user detached
    debug2: channel 0: send close
    debug2: channel 0: is dead
    debug2: channel 0: garbage collecting
    debug1: channel 0: free: client-session, nchannels 1
    Connection to localhost closed.
    Transferred: sent 1888, received 2168 bytes, in 562.1 seconds
    Bytes per second: sent 3.4, received 3.9
    debug1: Exit status 0

    Any help is greatly appreciated.

  2. #2
    SSH not listening to SSH port
    MacsWork's Avatar
    Member Since
    May 22, 2005
    Location
    Closer than you think.
    Posts
    2,159
    Specs:
    Performa 6116 2GBSCSI 8MB OS 7.5.3
    I've changed the ssh port in the past and at the time using the current OS (10.6) there were two files to edit.
    I don't recall the names but sshd or ssh_config come to mind.
    At the time I also setup ssl authentication requirements so that may have been the second config file I changed.
    Either way, using a port so high in the dynamic range may cause other issues. Using ports in the service port range might be more successful though I doubt it is your current problem.

  3. #3
    SSH not listening to SSH port
    MacsWork's Avatar
    Member Since
    May 22, 2005
    Location
    Closer than you think.
    Posts
    2,159
    Specs:
    Performa 6116 2GBSCSI 8MB OS 7.5.3

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how can I SSH to a linux box and then port forward to a Windows box?
    By wlandymore in forum OS X - Operating System
    Replies: 7
    Last Post: 01-31-2013, 09:14 AM
  2. Ssh
    By knightjp in forum OS X - Operating System
    Replies: 1
    Last Post: 03-29-2012, 04:37 PM
  3. Port 22 (SSH) Attack Daily!!!!
    By Aloco44 in forum Internet, Networking, and Wireless
    Replies: 5
    Last Post: 01-06-2011, 07:23 PM
  4. Ssh
    By watisgood in forum OS X - Operating System
    Replies: 6
    Last Post: 06-18-2008, 08:11 PM
  5. Ssh
    By Cpt. Morgan in forum OS X - Operating System
    Replies: 1
    Last Post: 05-26-2008, 08:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •