[Ubuntu-BR] RES: RES: RES: RES: RES: RES: Serviço SSH!

Glênio Côrtes Himmen glenio.himmen em aparecida.go.gov.br
Terça Maio 23 20:57:07 UTC 2017


root em dtrfisc005155:~# /usr/sbin/sshd -d -D
debug1: sshd version OpenSSH_7.3, OpenSSL 1.0.2g 1 Mar 2016
debug1: private host key #0: ssh-rsa SHA256:W/N/2K6uKPdNV/OPkJHLqJfdc1klL1LL9Xt1efkkVJE
debug1: private host key #1: ecdsa-sha2nistp256 SHA256:N7zyJyYEA94b0BVC5HtkS7SllaF6iNeB+aUHRKfY64
debug1: private host key #2: ssh-ed25519 SHA256:q0ofNKTOwAzgOgogljCrJg4qWTh887NRvRzHBiIUO5a
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
debug1: rexec_argv[2]='-D'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 2928 oon 172.16.0.96
Server listering on 172.16.0.96 port 2928.

Resultado de um acesso ssh via putty do Windows
login as: administrador
administrador em 172.16.0.96's password:
Welcome to Ubuntu 16.10 (GNU/Linux 4.8.0-51-generic i686)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

9 pacotes podem ser atualizados.
5 atualizações são atualizações de segurança.

Last login: Tue May 23 16:57:12 2017 from 172.16.0.4
Environment:
  USER=administrador
  LOGNAME=administrador
  HOME=/home/administrador
  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/                                                                                        usr/local/games
  MAIL=/var/mail/administrador
  SHELL=/bin/bash
  SSH_CLIENT=172.16.0.75 64807 2928
  SSH_CONNECTION=172.16.0.75 64807 172.16.0.96 2928
  SSH_TTY=/dev/pts/6
  TERM=xterm
  XDG_SESSION_ID=2
  XDG_RUNTIME_DIR=/run/user/1000
  DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
  LANG=pt_BR.UTF-8
  LANGUAGE=pt_BR:pt:en
administrador em dtrfisc005155:~$

Restante do log após um <CTRL>+D
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 4 out 4 newsock 4 pipe -1 sock 7
debug1: inetd sockets after dupping: 3, 3
Connection from 172.16.0.75 port 64807 on 172.16.0.96 port 2928
debug1: Client protocol version 2.0; client software version PuTTY_Release_0.67
debug1: no match: PuTTY_Release_0.67
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3p1 Ubuntu-1ubuntu0.1
debug1: permanently_set_uid: 126/65534 [preauth]
debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256 [preauth]
debug1: kex: host key algorithm: ssh-rsa [preauth]
debug1: kex: client->server cipher: aes256-ctr MAC: hmac-sha2-256 compression: none [preauth]
debug1: kex: server->client cipher: aes256-ctr MAC: hmac-sha2-256 compression: none [preauth]
debug1: expecting SSH2_MSG_KEX_DH_GEX_REQUEST [preauth]
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received [preauth]
debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent [preauth]
debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT [preauth]
debug1: rekey after 4294967296 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: rekey after 4294967296 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user administrador service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: PAM: initializing for "administrador"
debug1: PAM: setting PAM_RHOST to "172.16.0.75"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: userauth-request for user administrador service ssh-connection method password [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: PAM: password authentication accepted for administrador
debug1: do_pam_account: called
Accepted password for administrador from 172.16.0.75 port 64807 ssh2
debug1: monitor_child_preauth: administrador has been authenticated by privileged process
debug1: monitor_read_log: child log fd closed
debug1: PAM: establishing credentials
User child is on pid 19197
debug1: SELinux support disabled
debug1: PAM: establishing credentials
debug1: permanently_set_uid: 1000/1000
debug1: rekey after 4294967296 blocks
debug1: rekey after 4294967296 blocks
debug1: ssh_packet_set_postauth: called
debug1: Entering interactive session for SSH2.
debug1: server_init_dispatch_20
debug1: server_input_channel_open: ctype session rchan 256 win 16384 max 16384
debug1: input_session_request
debug1: channel 0: new [server-session]
debug1: session_new: session 0
debug1: session_open: channel 0
debug1: session_open: session 0: link with channel 0
debug1: server_input_channel_open: confirm session
debug1: server_input_channel_req: channel 0 request pty-req reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req pty-req
debug1: Allocating pty.
debug1: session_new: session 0
debug1: SELinux support disabled
debug1: session_pty_req: session 0 alloc /dev/pts/6
debug1: server_input_channel_req: channel 0 request shell reply 1
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req shell
Starting session: shell on pts/6 for administrador from 172.16.0.75 port 64807 id 0
debug1: Setting controlling tty using TIOCSCTTY.
debug1: server_input_channel_req: channel 0 request window-change reply 0
debug1: session_by_channel: session 0 channel 0
debug1: session_input_channel_req: session 0 req window-change
debug1: Received SIGCHLD.
debug1: session_by_pid: pid 19198
debug1: session_exit_message: session 0 channel 0 pid 19198
debug1: session_exit_message: release channel 0
debug1: session_by_tty: session 0 tty /dev/pts/6
debug1: session_pty_cleanup: session 0 release /dev/pts/6
debug1: session_by_channel: session 0 channel 0
debug1: session_close_by_channel: channel 0 child 0
Close session: user administrador from 172.16.0.75 port 64807 id 0
debug1: channel 0: free: server-session, nchannels 1
Connection closed by 172.16.0.75 port 64807
debug1: do_cleanup
Transferred: sent 4640, received 1848 bytes
Closing connection to 172.16.0.75 port 64807
debug1: PAM: cleanup
debug1: PAM: closing session
debug1: PAM: deleting credentials

Glênio Côrtes Himmen
Secretaria Municipal de Mobilidade e Transporte de Aparecida
glenio.himmen em aparecida.go.gov.br


-----Mensagem original-----
De: ubuntu-br-bounces em lists.ubuntu.com [mailto:ubuntu-br-bounces em lists.ubuntu.com] Em nome de Christian Rafael
Enviada em: terça-feira, 23 de maio de 2017 17:11
Para: Lista de discussão da Comunidade Ubuntu Brasil
Assunto: Re: [Ubuntu-BR] RES: RES: RES: RES: RES: Serviço SSH!

Boa tarde,

De acordo com o log a porta já está em uso, provavelmente o sshd já está em execução, se sua intenção é "debugar", pare o serviço com, sudo service ssh stop Logo após executa o sshd manualmente, /usr/sbin/sshd -d -D Se executar, tenta efetuar o login, ssh localhost -p2928 E envia os respectivos logs pra gente.

Até mais.

Em 23 de maio de 2017 16:57, Glênio Côrtes Himmen < glenio.himmen em aparecida.go.gov.br> escreveu:

> root em dtrfisc005155:~# /usr/sbin/sshd -d -D
> debug1: sshd version OpenSSH_7.3, OpenSSL 1.0.2g  1 Mar 2016
> debug1: private host key #0: ssh-rsa SHA256:W/N/2K6uKPdNV/ 
> OPkJHLqJfdc1klL1LL9Xt1efkkVJE
> debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:
> N7hzyJyYEA94bOBVC5HtkS7SllaF6iNeB+aUHRKfY64
> debug1: private host key #2: ssh-ed25519 SHA256:
> q0ofNKTOwAzgOgogljCrJg4qWTh887NRvRzHBiIUO5s
> debug1: rexec_argv[0]='/usr/sbin/sshd'
> debug1: rexec_argv[1]='-d'
> debug1: rexec_argv[2]='-D'
> debug1: Set /proc/self/oom_score_adj from 0 to -1000
> debug1: Bind to port 2928 on 172.16.0.96.
> Bind to port 2928 on 172.16.0.96 failed: Address already in use.
> Cannot bind any address.
>
> Glênio Côrtes Himmen
> Secretaria Municipal de Mobilidade e Transporte de Aparecida 
> glenio.himmen em aparecida.go.gov.br
>
> -----Mensagem original-----
> De: ubuntu-br-bounces em lists.ubuntu.com [mailto:ubuntu-br-bounces@ 
> lists.ubuntu.com] Em nome de Christian Rafael Enviada em: 
> segunda-feira, 22 de maio de 2017 18:47
> Para: Lista de discussão da Comunidade Ubuntu Brasil
> Assunto: Re: [Ubuntu-BR] RES: RES: RES: RES: Serviço SSH!
>
> Boa noite,
>
> Digita "which sshd", ele vai retornar algo do tipo /usr/bin/sshd, 
> então você executa com o caminho.
> Ex: sudo /usr/bin/sshd
>
> Se você receber o erro "Could not load host key".
>
> Rode o comando /usr/bin/ssh-keygen -A
>
> Para executar o serviço na inicialização, update-rc.d ssh enable
>
> Seja cuidadoso com o *sudo*.
>
> Até mais.
>
> Em 22 de maio de 2017 18:19, Glênio Côrtes Himmen < 
> glenio.himmen em aparecida.go.gov.br> escreveu:
>
> > Desculpe não sabia da diferença.
> >
> > Ao executar sshd -d -D recebo a mensagem de erro abaixo.
> >
> > sshd re-exec requires execution with an absolute path
> >
> > Glênio Côrtes Himmen
> > Secretaria Municipal de Mobilidade e Transporte de Aparecida 
> > glenio.himmen em aparecida.go.gov.br
> >
> > -----Mensagem original-----
> > De: ubuntu-br-bounces em lists.ubuntu.com [mailto:ubuntu-br-bounces@ 
> > lists.ubuntu.com] Em nome de C de-Avillez Enviada em: sábado, 20 de 
> > maio de 2017 17:24
> > Para: ubuntu-br em lists.ubuntu.com
> > Assunto: Re: [Ubuntu-BR] RES: RES: RES: Serviço SSH!
> >
> > On Fri, 19 May 2017 11:06:54 -0300
> > Glênio Côrtes Himmen <glenio.himmen em aparecida.go.gov.br> wrote:
> >
> > > O comando SSH não tem o parâmetro -d.
> >
> > sshd, não ssh. 'ssh' é o cliente, sshd o servidor.
> >
> > [cerdea-aws]cerdea em icatu:/data/buildd/claws$ /usr/sbin/sshd -d -D
> > debug1: sshd version OpenSSH_7.4, OpenSSL 1.0.2g  1 Mar 2016
> > debug1: key_load_private: Permission denied Could not load host key:
> > /etc/ssh/ssh_host_rsa_key
> > debug1: key_load_private: Permission denied Could not load host key:
> > /etc/ssh/ssh_host_ecdsa_key
> > debug1: key_load_private: Permission denied Could not load host key:
> > /etc/ssh/ssh_host_ed25519_key
> > debug1: setgroups() failed: Operation not permitted
> > debug1: rexec_argv[0]='/usr/sbin/sshd'
> > debug1: rexec_argv[1]='-d'
> > debug1: rexec_argv[2]='-D'
> > debug1: Set /proc/self/oom_score_adj from 0 to -1000
> > debug1: Bind to port 22 on 0.0.0.0.
> > Bind to port 22 on 0.0.0.0 failed: Permission denied.
> > debug1: Bind to port 22 on ::.
> > Bind to port 22 on :: failed: Permission denied.
> > Cannot bind any address.
> >
> > (os erros são esperados, dado que executei 'sshd' como um usuário
> > nromal.)
> > >
> > > Com o parâmetro -D ele exige bind_address e port.
> > >
> > > Coloquei o endereço 172.16.0.66:2928 e recebo a mensagem Bad 
> > > dynamics forwarding specification.
> >
> > Sim. Para o cliente 'ssh', uma porta diferente deve ser passada com 
> > o parametro '-p': -p 2928
> >
> > <snip/>
> >
> >
> > --
> > Mais sobre o Ubuntu em português: http://www.ubuntu-br.org/comece
> >
> > Lista de discussão Ubuntu Brasil
> > Histórico, descadastramento e outras opções:
> > https://lists.ubuntu.com/mailman/listinfo/ubuntu-br
> >
>
>
> --
> Mais sobre o Ubuntu em português: http://www.ubuntu-br.org/comece
>
> Lista de discussão Ubuntu Brasil
> Histórico, descadastramento e outras opções:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-br
>




Mais detalhes sobre a lista de discussão ubuntu-br