[英]how to skip banners while login into remote machine using expect script?
[英]How to login to a remote machine
我想從我的計算機登錄到遠程計算機,以便可以訪問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
$
在分析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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.