使用从 Amazon ec2 获得的公钥将 Eclipse RSE 与远程 Linux 服务器连接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4680629/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Connect Eclipse RSE with remote Linux server using public key attained from Amazon ec2
提问by einstein
I want a easy way to save, copy and edit files on a remote server. I'm using Eclipse as an IDE, what could be better for these tasks than RSE(Remote System Exlporer) plugin for Eclipse. The thing is that I dont know how to make a connection using a public key. I have file that I downloaded from my Amazon account, *.pem. But I don't see any forms or inputs for this, when I try to connect to my remote Linux server. It is just User-id and password. I also tried to open the public key using the system's text editor and copy everything to my password field, but it didn't worked. Pls help me
我想要一种在远程服务器上保存、复制和编辑文件的简单方法。我使用 Eclipse 作为 IDE,对于这些任务来说,有什么比 Eclipse 的 RSE(远程系统资源管理器)插件更好的了。问题是我不知道如何使用公钥建立连接。我有从我的 Amazon 帐户下载的文件*.pem。但是当我尝试连接到我的远程 Linux 服务器时,我没有看到任何表单或输入。它只是用户 ID 和密码。我还尝试使用系统的文本编辑器打开公钥并将所有内容复制到我的密码字段,但没有奏效。请帮助我
回答by turbohoje
this was baking my noodle for a while too. you put the keys in a folder not in the RSE config but in the whole of eclipse
这也让我的面条烤了一段时间。您将密钥放在一个文件夹中,而不是在 RSE 配置中,而是在整个 eclipse 中
check this: http://siteadmin.gforge.inria.fr/eclipse-ssh.html
回答by Hito_kun
Not mentioned (at least in explicitly) is the fact that RSE (and for what I've seen, Eclipse in general) only seems to work with 1024 bit keys https://bugs.eclipse.org/bugs/show_bug.cgi?id=404714
没有提到(至少明确地)是 RSE(以及我所看到的,一般来说,Eclipse)似乎只适用于 1024 位密钥https://bugs.eclipse.org/bugs/show_bug.cgi?编号=404714
I also had issues, because my privatekey was 2048, but I added a new key to authorized hosts and then I could connect.
我也有问题,因为我的私钥是 2048,但我向授权主机添加了一个新密钥,然后我就可以连接了。
回答by Alfonso Nishikawa
I added my local computer's ~/.ssh/id_rsa.pub
to the remote /home/ec2-user/.ssh/authorized_keys
.
Then just set the user to connect in RSE to ec2-user
when connecting.
我将本地计算机添加~/.ssh/id_rsa.pub
到远程/home/ec2-user/.ssh/authorized_keys
. 然后只需在连接ec2-user
时将用户设置为在 RSE 中连接即可。
Someone asked for root
login. It works too: update /root/.ssh/authorized_keys
, and edit /etc/ssh/sshd_config
to allow root login:
有人要求root
登录。它也有效:更新/root/.ssh/authorized_keys
和编辑/etc/ssh/sshd_config
以允许 root 登录:
#PermitRootLogin forced-commands-only
PubkeyAuthentication yes
Then reload the sshd daemon: service sshd restart
然后重新加载 sshd 守护进程: service sshd restart