具有多个虚拟机的SSH

时间:2018-12-11 17:46:00

标签: amazon-ec2 ssh parallel-processing mpi

我目前正在使用亚马逊的aws,我想做的是创建两个虚拟机,第一个是名为“ master”的主虚拟机,第二个是名为“ node1”的从属虚拟机。

我想在VM主服务器上运行一个程序,以便在从属计算机上分发任务。如果一切正常,我想创建多个从属并创建并行系统。

在亚马逊aws上,要连接到虚拟机,我们必须使用aws生成的xxx.pem文件通过ssh -i“ xxx.pem” xxx @ xxx来标识自己

但是在我的情况下,我在主VM中创建了一个“主”用户,然后通过执行ssh-keygen -t rsa生成了一个空白密码。我复制并粘贴到我自己创建的从属VM的/home/node1/.ssh/上的“ authorized_keys”文件中。

现在,当我尝试执行ssh node1@xxx.xxx.xxx.xxx时,他要求我输入密码...我不明白为什么?

尝试了所有我无法使用ssh name @ private_ip连接后,他每次都要求我输入密码。

我该怎么办?

谢谢!

1 个答案:

答案 0 :(得分:0)

服务器端日志:

debug2: load_server_config: filename /etc/ssh/sshd_config
/etc/ssh/sshd_config: Permission denied
[ec2-user@ip-172-31-35-17 ~]$ sudo su
[root@ip-172-31-35-17 ec2-user]# /usr/sbin/sshd -D -p 8022 -ddd
debug2: load_server_config: filename /etc/ssh/sshd_config
debug2: load_server_config: done config len = 728
debug2: parse_server_config: config /etc/ssh/sshd_config len 728
debug3: /etc/ssh/sshd_config:22 setting HostKey /etc/ssh/ssh_host_rsa_key
debug3: /etc/ssh/sshd_config:24 setting HostKey /etc/ssh/ssh_host_ecdsa_key
debug3: /etc/ssh/sshd_config:25 setting HostKey /etc/ssh/ssh_host_ed25519_key
debug3: /etc/ssh/sshd_config:32 setting SyslogFacility AUTHPRIV
debug3: /etc/ssh/sshd_config:40 setting PermitRootLogin forced-commands-only
debug3: /etc/ssh/sshd_config:49 setting AuthorizedKeysFile .ssh/authorized_keys
debug3: /etc/ssh/sshd_config:65 setting PasswordAuthentication no
debug3: /etc/ssh/sshd_config:70 setting ChallengeResponseAuthentication no
debug3: /etc/ssh/sshd_config:97 setting UsePAM yes
debug3: /etc/ssh/sshd_config:102 setting X11Forwarding yes
debug3: /etc/ssh/sshd_config:107 setting PrintLastLog yes
debug3: /etc/ssh/sshd_config:110 setting UsePrivilegeSeparation sandbox
debug3: /etc/ssh/sshd_config:127 setting AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
debug3: /etc/ssh/sshd_config:128 setting AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
debug3: /etc/ssh/sshd_config:129 setting AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
debug3: /etc/ssh/sshd_config:130 setting AcceptEnv XMODIFIERS
debug3: /etc/ssh/sshd_config:133 setting Subsystem sftp /usr/libexec/openssh/sftp-server
debug1: sshd version OpenSSH_7.4, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: private host key #0: ssh-rsa SHA256:sHblS+34MhcBEtE/kCxfAoJ1fcZJyu4tYZKdcDEeQ4E
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:BLgYMx1fFNlmkUpwqdp61g98k+ojM2TV2L1KYPmYdao
debug1: private host key #2: ssh-ed25519 SHA256:/SXACNF7WrrjPDcCsxFYX6Km9jfyAtA0pisg6VFxxIM
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-D'
debug1: rexec_argv[2]='-p'
debug1: rexec_argv[3]='8022'
debug1: rexec_argv[4]='-ddd'
debug3: oom_adjust_setup
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug2: fd 3 setting O_NONBLOCK
debug1: Bind to port 8022 on 0.0.0.0.
Server listening on 0.0.0.0 port 8022.
debug2: fd 4 setting O_NONBLOCK
debug3: sock_set_v6only: set socket 4 IPV6_V6ONLY
debug1: Bind to port 8022 on ::.
Server listening on :: port 8022.