[Risolto] Collegamento tra Desktop e Portatile via SSH e LAN

Buonasera, i 2 computer in oggetto hanno entrambi installato Fedora 31.
Vorrei collegarli reciprocamente in un sistema di rete LAN per poter accedere l’uno (A) ad una cartella condivisa dell’altro (B).
Ho verificato ed attivato il servizio OpenSSH in entrambi.
Il client riconosce il server ma al momento di accedervi non riconosce l’utente o la password.
Con il ping li vedo entrambi (uno chiama l’altro e viceversa).
Mi potete aiutare? grazie.

da A cerco B:

[sanp@localhost log]$ ping 192.168.43.225

PING 192.168.43.225 (192.168.43.225) 56(84) bytes of data.
64 bytes from 192.168.43.225: icmp_seq=1 ttl=64 time=0.328 ms
64 bytes from 192.168.43.225: icmp_seq=2 ttl=64 time=0.270 ms
64 bytes from 192.168.43.225: icmp_seq=3 ttl=64 time=0.317 ms
[sanp@localhost log]$ ssh -vvv 192.168.43.225
OpenSSH_8.1p1, OpenSSL 1.1.1d FIPS  10 Sep 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 51: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug2: checking match for 'final all' host 192.168.43.225 originally 192.168.43.225
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: not matched 'final'
debug2: match not found
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only)
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug3: gss kex names ok: [gss-gex-sha1-,gss-group14-sha1-,gss-group1-sha1-]
debug3: kex names ok: [curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1]
debug1: configuration requests final Match pass
debug2: resolve_canonicalize: hostname 192.168.43.225 is address
debug1: re-parsing configuration
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 51: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug2: checking match for 'final all' host 192.168.43.225 originally 192.168.43.225
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: matched 'final'
debug2: match found
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug3: gss kex names ok: [gss-gex-sha1-,gss-group14-sha1-,gss-group1-sha1-]
debug3: kex names ok: [curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1]
debug2: ssh_connect_direct
debug1: Connecting to 192.168.43.225 [192.168.43.225] port 22.
debug1: Connection established.
debug1: identity file /home/sanp/.ssh/id_rsa type 0
debug1: identity file /home/sanp/.ssh/id_rsa-cert type -1
debug1: identity file /home/sanp/.ssh/id_dsa type -1
debug1: identity file /home/sanp/.ssh/id_dsa-cert type -1
debug1: identity file /home/sanp/.ssh/id_ecdsa type -1
debug1: identity file /home/sanp/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/sanp/.ssh/id_ed25519 type -1
debug1: identity file /home/sanp/.ssh/id_ed25519-cert type -1
debug1: identity file /home/sanp/.ssh/id_xmss type -1
debug1: identity file /home/sanp/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.1
debug1: match: OpenSSH_8.1 pat OpenSSH* compat 0x04000000
debug2: fd 4 setting O_NONBLOCK
debug1: Authenticating to 192.168.43.225:22 as 'sanp'
debug3: hostkeys_foreach: reading file "/home/sanp/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/sanp/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys from 192.168.43.225
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,ext-info-c
debug2: host key algorithms: [email protected],[email protected],[email protected],rsa-sha2-512,rsa-sha2-256,ssh-rsa,[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
debug2: ciphers ctos: [email protected],[email protected],aes256-ctr,aes256-cbc,[email protected],aes128-ctr,aes128-cbc
debug2: ciphers stoc: [email protected],[email protected],aes256-ctr,aes256-cbc,[email protected],aes128-ctr,aes128-cbc
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha1,[email protected],hmac-sha2-512
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha1,[email protected],hmac-sha2-512
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: [email protected],[email protected],aes256-ctr,aes256-cbc,[email protected],aes128-ctr,aes128-cbc
debug2: ciphers stoc: [email protected],[email protected],aes256-ctr,aes256-cbc,[email protected],aes128-ctr,aes128-cbc
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha1,[email protected],hmac-sha2-512
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha1,[email protected],hmac-sha2-512
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: curve25519-sha256 need=32 dh_need=32
debug1: kex: curve25519-sha256 need=32 dh_need=32
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ssh-rsa SHA256:hMJjEWKGWzgWiLcmwPNHr/SEzCjnxzcqjLnk9FNK6oE
debug3: hostkeys_foreach: reading file "/home/sanp/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/sanp/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys from 192.168.43.225
debug1: Host '192.168.43.225' is known and matches the RSA host key.
debug1: Found key in /home/sanp/.ssh/known_hosts:3
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey in after 4294967296 blocks
debug1: Will attempt key: /home/sanp/.ssh/id_rsa RSA SHA256:Gq/ZyrKiCfqHtcCZg55kGaYt6b6Rgrdec5RsQEsDRKs
debug1: Will attempt key: /home/sanp/.ssh/id_dsa 
debug1: Will attempt key: /home/sanp/.ssh/id_ecdsa 
debug1: Will attempt key: /home/sanp/.ssh/id_ed25519 
debug1: Will attempt key: /home/sanp/.ssh/id_xmss 
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password
debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: KCM:)


debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: KCM:)


debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/sanp/.ssh/id_rsa RSA SHA256:Gq/ZyrKiCfqHtcCZg55kGaYt6b6Rgrdec5RsQEsDRKs
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/sanp/.ssh/id_dsa
debug3: no such identity: /home/sanp/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/sanp/.ssh/id_ecdsa
debug3: no such identity: /home/sanp/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/sanp/.ssh/id_ed25519
debug3: no such identity: /home/sanp/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: /home/sanp/.ssh/id_xmss
debug3: no such identity: /home/sanp/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
[email protected]'s password:

debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
[email protected]'s password:

sanp è il nome utente in entrambi!

hai valutato di usare il servizio Samba (smb.service)? Con samba puoi traferire files tra Hosts diversi connessi ad una Lan locale. Cerca Samba sul Forum.

Il servizio si chiama “sshd”.
Vediamo se questo servizio è startato o meno.
Posta qui il risultato del seguente comando dato come root su ambedue i computer.

systemctl status sshd

Ciao.
Sergio

Ciao,
l’utente “sanp” esiste sul server su cui vuoi accedere in remoto?
Hai provato con un’altra utenza?

Nel frattempo sono riuscito ad effettuare il collegamento!
I problemi erano 2 e molto banali.
1)
ssh root@indirizzoServer :

mi negava l’accesso: ho dovuto modificare /etc/ssh/sshd_config inserendo:

PermitRootLogin yes

Dopo aver creato una chiave pubblica ho ripristinato la versione originale del file.

ssh user@indirizzoServer:

mi negava l’accesso perchè nel server l’utente user era senza password. Ho dovuto attriburne una!

Grazie dell’attenzione !!