Как войти на удаленную машину - PullRequest
0 голосов
/ 11 июня 2018

Я хочу войти в удаленный компьютер со своего компьютера, чтобы я мог получить доступ к общим ресурсам NFS.Я использовал следующую команду:

ssh -l salini 192.168.164.78

Но теперь я получаю это:

Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 4.2.0-34-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

584 packages can be updated.
0 updates are security updates.


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Could not chdir to home directory /home/salini: No such file or directory
$ 

Что это значит?Я нахожусь на машине с IP: 172.21.215.101

Я хочу войти на другую машину с IP: 192.168.164.78 и с именем пользователя: salini

Как я могу сделатьэто?

Пожалуйста, помогите мне.Спасибо.

Теперь я запустил ssh в режиме отладки.Вот что я получил:

OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.164.78 [192.168.164.78] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/test/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/test/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/test/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/test/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/test/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/test/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/test/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/test/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to 192.168.164.78:22 as 'salini'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:m/cExZWCnjGc0Vr56HbDDMZRunfoBXkpwPWhZJKi3Qc
debug1: Host '192.168.164.78' is known and matches the ECDSA host key.
debug1: Found key in /home/test/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
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
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available

debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available

debug1: Unspecified GSS failure.  Minor code may provide more information


debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available

debug1: Next authentication method: publickey
debug1: Trying private key: /home/test/.ssh/id_rsa
debug1: Trying private key: /home/test/.ssh/id_dsa
debug1: Trying private key: /home/test/.ssh/id_ecdsa
debug1: Trying private key: /home/test/.ssh/id_ed25519
debug1: Next authentication method: keyboard-interactive
Password: 
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to 192.168.164.78 ([192.168.164.78]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LANG = en_IN
Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 4.2.0-34-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

584 packages can be updated.
0 updates are security updates.


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.


The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

    Could not chdir to home directory /home/salini: No such file or directory
    $ 

1 Ответ

0 голосов
/ 11 июня 2018

Проанализировав подробный вывод ssh-клиента, мы обнаружили, что:

debug1: Connecting to 192.168.164.78 [192.168.164.78] port 22. debug1: Connection established.

Сервер был достигнут (нет проблем с сетью), и ваш ssh-клиент установит соединение по умолчанию через порт 22.

debug1: Authenticating to 192.168.164.78:22 as 'salini'

ваш клиент попытается аутентифицировать вас как salini Он будет проходить через различные методы аутентификации, доступные (один за другим):

debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive

В конце он спроситвы за ваш пароль, так как он не мог аутентифицировать вас с помощью kerberos, publickey

debug1: Next authentication method: keyboard-interactive Password: debug1: Authentication succeeded (keyboard-interactive). Authenticated to 192.168.164.78 ([192.168.164.78]:22). 

Вы ввели пароль и теперь вы подключены к серверу

Теперь единственная проблемаэто то, что ваш $HOMEDIR исчез по некоторым причинам ...

Could not chdir to home directory /home/salini: No such file or directory
...