Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用shell脚本登录linux虚拟机_Linux_Bash_Ssh - Fatal编程技术网

使用shell脚本登录linux虚拟机

使用shell脚本登录linux虚拟机,linux,bash,ssh,Linux,Bash,Ssh,我们有云虚拟机,可以通过WinSCP&Putty使用pem和ppk文件登录。我将编写一个shell脚本程序来登录这些机器。我尝试了类似的操作,但没有成功 ssh -i ~/ec2.pem ubuntu@12.34.56.78 Permissions 0664 for '/home/cloud-user/house_keeping/conf/ecp.pem' are too open. It is required that your private key files are NOT acce

我们有云虚拟机,可以通过WinSCP&Putty使用pem和ppk文件登录。我将编写一个shell脚本程序来登录这些机器。我尝试了类似的操作,但没有成功

ssh -i ~/ec2.pem ubuntu@12.34.56.78

Permissions 0664 for '/home/cloud-user/house_keeping/conf/ecp.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /home/cloud-user/house_keeping/conf/ecp.pem`enter code here`
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
问题是

Permissions 0664 for '/home/cloud-user/house_keeping/conf/ecp.pem' are too open.
ssh
的手册页面解释了私钥上应具有的权限:

这些文件包含敏感数据,用户可以读取,但其他人无法访问(读/写/执行)

因此,您应该使用将权限更改为0600

chmod 600 ~/ec2.pem

如果这是一个shell脚本问题,为什么会有
python
标记?