Linux 如何登录到远程计算机

Linux 如何登录到远程计算机,linux,ssh,terminal,remote-server,Linux,Ssh,Terminal,Remote Server,我想从我的计算机登录到远程计算机,以便访问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.

我想从我的计算机登录到远程计算机,以便访问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
    $ 
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1,OpenSSL 1.0.2g 2016年3月1日
debug1:读取配置数据/etc/ssh/ssh\u config
debug1:/etc/ssh/ssh\u配置第19行:应用*
debug1:连接到192.168.164.78[192.168.164.78]端口22。
debug1:已建立连接。
debug1:key\u load\u public:没有这样的文件或目录
debug1:identity file/home/test/.ssh/id\u rsa type-1
debug1:key\u load\u public:没有这样的文件或目录
debug1:identity file/home/test/.ssh/id\u rsa-cert类型-1
debug1:key\u load\u public:没有这样的文件或目录
debug1:identity file/home/test/.ssh/id_dsa type-1
debug1:key\u load\u public:没有这样的文件或目录
debug1:identity file/home/test/.ssh/id_dsa-cert type-1
debug1:key\u load\u public:没有这样的文件或目录
debug1:identity file/home/test/.ssh/id_ecdsa type-1
debug1:key\u load\u public:没有这样的文件或目录
debug1:identity file/home/test/.ssh/id_ecdsa-cert type-1
debug1:key\u load\u public:没有这样的文件或目录
debug1:identity file/home/test/.ssh/id_ed25519 type-1
debug1:key\u load\u public:没有这样的文件或目录
debug1:identity file/home/test/.ssh/id_ed25519-cert type-1
debug1:启用协议2.0的兼容模式
debug1:本地版本字符串SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1:远程协议版本2.0,远程软件版本OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6
debug1:match:OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6 pat OpenSSH_6.6.1*compat 0x04000000
debug1:将192.168.164.78:22验证为“salini”
debug1:SSH2\u MSG\u KEXINIT已发送
debug1:SSH2\u MSG\u KEXINIT已收到
debug1:kex:算法:curve25519-sha256@libssh.org
debug1:kex:主机密钥算法:ecdsa-sha2-nistp256
debug1:kex:server->client cipher:chachacha20-poly1305@openssh.comMAC:压缩:无
debug1:kex:client->server cipher:chachacha20-poly1305@openssh.comMAC:压缩:无
debug1:需要SSH2\u MSG\u KEX\u ECDH\u回复
debug1:服务器主机密钥:ecdsa-sha2-nistp256 SHA256:m/cExZWCnjGc0Vr56HbDDMZRunfoBXkpwPWhZJKi3Qc
debug1:主机“192.168.164.78”已知,并且与ECDSA主机密钥匹配。
debug1:在/home/test/.ssh/known_hosts中找到密钥:1
debug1:在134217728块之后重新键入
debug1:SSH2\u MSG\u已发送新密钥
debug1:应为SSH2\u MSG\u NEWKEYS
debug1:在134217728块之后重新键入
debug1:SSH2\u MSG\u接收到新密钥
debug1:SSH2\u消息\u服务\u接收
debug1:可以继续的身份验证:publickey、gssapi keyex、带麦克风的gssapi、密码、键盘交互
debug1:下一个身份验证方法:gssapi-keyex
debug1:没有有效的密钥交换上下文
debug1:下一个身份验证方法:带麦克风的gssapi
debug1:未指定的GSS故障。次要代码可能提供更多信息
没有可用的Kerberos凭据
debug1:未指定的GSS故障。次要代码可能提供更多信息
没有可用的Kerberos凭据
debug1:未指定的GSS故障。次要代码可能提供更多信息
debug1:未指定的GSS故障。次要代码可能提供更多信息
没有可用的Kerberos凭据
debug1:下一个身份验证方法:公钥
debug1:正在尝试私钥:/home/test/.ssh/id\u rsa
debug1:正在尝试私钥:/home/test/.ssh/id\u dsa
debug1:正在尝试私钥:/home/test/.ssh/id\u ecdsa
debug1:正在尝试私钥:/home/test/.ssh/id_ed25519
debug1:下一个身份验证方法:键盘交互
密码:
debug1:身份验证成功(键盘交互)。
已验证为192.168.164.78([192.168.164.78]:22)。
调试1:通道0:新建[客户端会话]
debug1:不再请求-sessions@openssh.com
debug1:进入交互式会话。
debug1:保证:网络
debug1:发送环境。
debug1:正在发送env LANG=en_
欢迎使用Ubuntu 14.04.4 LTS(GNU/Linux 4.2.0-34-generic x86_64)
*文件:https://help.ubuntu.com/
584个包可以更新。
0更新是安全更新。
Ubuntu系统附带的程序是自由软件;
每个程序的确切分布术语在
/usr/share/doc/*/版权中的单个文件。
Ubuntu在许可的范围内绝对没有保修
适用法律。
Ubuntu系统附带的程序是自由软件;
每个程序的确切分布术语在
/usr/share/doc/*/版权中的单个文件。
Ubuntu在许可的范围内绝对没有保修
适用法律。
无法chdir到主目录/home/salini:没有这样的文件或目录
$ 

在分析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
它将经历可用的不同身份验证方法(一个接一个):

最后,他会询问您的密码,因为他无法使用
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

您确定尚未登录到该计算机上吗?您是否可以尝试运行命令
hostname
并使用
hostname
的结果执行nslookup,以查看所连接主机的IP?您还可以运行
ifconfig
并检查远程服务器的某个接口的IP是否与命令的IP匹配我检查了“ifconfig”命令和IP不匹配。您尝试过主机名的方法吗
Could not chdir to home directory /home/salini: No such file or directory