Eu planejo usar uma torre de desktop recém-adquirida como um servidor, e gostaria de começar configurando o serviço SSH. Até agora não tive sucesso e acredito que o problema é que o IP do meu computador é controlado pelo complexo de apartamentos em que eu moro e, portanto, pareço ter controle restrito (ou seja, sem controle) sobre a ligação de portas.
Existe alguma solução para isso?
(P.S. eu ainda estou aprendendo enquanto vou, então qualquer conselho à mão na sua resposta também será muito apreciado!)
Editar 1:
sshd_config
:
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for, just picked a port at random
# because none were working
Port 380
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
ListenAddress [IP Address of Apartment Complex]
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
PermitRootLogin no
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords yes
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
# 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 yes
Saída de sudo systemctl start ssh
:
Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details.
Saída de systemctl status ssh.service
:
ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-06-05 22:15:30 PDT; 14s ago
Process: 2288 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
Process: 6579 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
Main PID: 6579 (code=exited, status=255)
Jun 05 22:15:30 Case systemd[1]: Starting OpenBSD Secure Shell server...
Jun 05 22:15:30 Case systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
Jun 05 22:15:30 Case systemd[1]: Failed to start OpenBSD Secure Shell server.
Jun 05 22:15:30 Case systemd[1]: ssh.service: Unit entered failed state.
Jun 05 22:15:30 Case systemd[1]: ssh.service: Failed with result 'exit-code'.
Saída truncada de 'journalctl -xe':
Unit ssh.service has begun starting up.
Jun 05 22:15:30 Case sshd[6579]: error: Bind to port 380 on [IP Address of My Apartment Complex] failed: Cannot assign requested address.
Jun 05 22:15:30 Case sshd[6579]: fatal: Cannot bind any address.
Jun 05 22:15:30 Case systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
Jun 05 22:15:30 Case systemd[1]: Failed to start OpenBSD Secure Shell server.
-- Subject: Unit ssh.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit ssh.service has failed.
Outros detalhes:
Estou conectado a um roteador sem fio que, por sua vez, está conectado à parede (por isso, o endereço IP é o do complexo de apartamentos)
Espero que sejam detalhes suficientes!