Login SSH remoto bloqueado sem login local do Gnome

3

Instalei o CentOS 6.7 da mídia de instalação completa em uma máquina desktop em casa. sshd foi reconfigurado apenas para autenticação de chave privada.

Quando eu vou fazer login via SSH do meu laptop (OS X Yosemite, na mesma rede local) para a caixa Linux, ele só funciona quando eu realmente tiver feito login via Gnome localmente. Não há erro de autenticação, apenas bloqueia e, eventualmente, expira. Depois de fazer login localmente pelo Gnome, posso fazer login remotamente. Assim que faço logout via Gnome localmente, a conexão SSH remota é bloqueada novamente (incluindo conexões abertas). Se eu fizer login novamente localmente, as conexões serão desbloqueadas novamente. Eu nunca tive esse problema ao se conectar a servidores remotos sem cabeça (AWS, outros provedores VPS).

Por que um login remoto está sendo bloqueado sem a presença de um login local?

Aqui está toda a configuração relevante (espero).

ls -al ~/.ssh

drwx------.  2 chris chris 4096 Sep 16 09:25 .
drwx------. 35 chris chris 4096 Sep 16 11:28 ..
-rw-------.  1 chris chris  391 Sep 16 09:25 authorized_keys
-rw-------.  1 chris chris 3311 Sep 15 17:53 id_rsa
-rw-r--r--.  1 chris chris  737 Sep 15 17:53 id_rsa.pub
-rw-r--r--.  1 chris chris  416 Sep 15 18:02 known_hosts

chkconfig | grep ssh

sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off

iptables --list

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh 
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

cat /etc/ssh/sshd_config

#   $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm 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
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2

# 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 1024

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

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedKeysCommand none
#AuthorizedKeysCommandRunAs nobody

# 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 no

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

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

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials no
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# 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 and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to '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 LANGUAGE
AcceptEnv XMODIFIERS

#AllowAgentForwarding yes
#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
UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem   sftp    /usr/libexec/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#   X11Forwarding no
#   AllowTcpForwarding no
#   ForceCommand cvs server
    
por Chris C 16.09.2015 / 18:38

2 respostas

2

Isso acontece por causa de suas configurações de NetworkManager para a interface de rede .

Você precisa garantir que ambos dessas configurações estejam ativados:

  • Conecte-se automaticamente
  • Disponível para todos os usuários

Por padrão, para uma conexão sem fio como a sua, "Disponível para todos os usuários" está desabilitado por padrão. Isso é ativado por padrão apenas para conexões com fio .

Quando configuradas, essas configurações fazem com que a conexão seja ativada no momento da inicialização, em vez de estarem associadas a um usuário. Nesse caso, elas são ativadas somente quando o usuário faz login no console.

    
por 16.09.2015 / 23:21
2

Resolvido. O problema está em que as conexões de rede foram configuradas pelo NetworkManager, que o Gnome não inicia até que um login tenha ocorrido. Também os rasga quando você sai. Uggh.

Não há mais o NetworkManager , não há mais problemas.

    
por 16.09.2015 / 21:17

Tags