【问题标题】:Eclipse password recoveryEclipse 密码恢复
【发布时间】:2012-10-27 13:50:25
【问题描述】:

我试图找到方法来获取我存储在 Eclipse 中用于 FTP 的几个密码。

我在 Ubuntu 12.04 上使用 Eclipse 4 (juno),并使用 RSE 插件存储所有 ftp。

找到本教程Eclipse password recovery (cvs, subversion, ..),但似乎已过时。而且我不是Java程序员,所以对我来说有点困难。

注意到在新的 Eclipse 中,所有密码都使用 Equinox 存储,所以我还找到了这个 Interface ISecurePreferences 文档。

和上面的第一个链接一样,我尝试安装 Eclipse-shell 并在那里执行下一个代码:

import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
import org.eclipse.equinox.security.storage.ISecurePreferences;

ISecurePreferences root = SecurePreferencesFactory.getDefault();

root.nodeExists("org.eclipse.rse.core.security");
ISecurePreferences coresec = root.node("org.eclipse.rse.core.security");

coresec.nodeExists("org.eclipse.rse.systemtype.ftp");
ISecurePreferences typeftp = root.node("org.eclipse.rse.systemtype.ftp");

pass = typeftp.get("HERE_FTP_HOST/HERE_MY_FTP_USER_NAME", "test");

但我得到的是“test”而不是密码

我也尝试使用typeftp.keys() 检查所有键,但在 Eclipse 控制台中我得到了[Ljava.lang.String;@c5d03e6

如何在 Eclipse 中找回密码?

【问题讨论】:

  • Equinox 将密码存储在~/.eclipse_keyring
  • 是的,但是所有密码都加密了
  • equinox source, SecurePreferences.put()
  • 抱歉不是很明白诀窍在哪里;)

标签: java eclipse equinox password-recovery eclipse-rse


【解决方案1】:

一篇基于上面引用的教程博客文章,但带有解释和可下载的源文件,用于恢复 SVN/FTP/SFTP 远程连接密码is here

【讨论】:

  • 谢谢!它看起来更有用......制作导出/导入插件有多难?
【解决方案2】:

在 Kepler 和 Luna 中,密码似乎在 ~/.eclipse/org.eclipse.equinox.security/secure_storage 中。一个基于 hello world 插件的简单插件,用于打印安全存储的内容,例如 here.

【讨论】:

    【解决方案3】:

    好的,我发现......我的代码有错误。

    获取存储在 Eclipse RSE 中的 FTP 密码的正确代码是:

    import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
    import org.eclipse.equinox.security.storage.ISecurePreferences;
    
    ISecurePreferences root = SecurePreferencesFactory.getDefault();
    
    ISecurePreferences coresec = root.node("org.eclipse.rse.core.security");
    
    ISecurePreferences typeftp = coresec.node("org.eclipse.rse.systemtype.ftp");
    
    pass = typeftp.get("HERE_FTP_HOST//HERE_MY_FTP_USER_NAME", "test");
    

    结果我在 Eclipse 控制台中获得了解密后的密码

    但如果有人向我解释如何使用某些东西来获取所有密码以进行更简单的导出,而不是手动复制/粘贴每个值,那也会很好

    【讨论】:

      猜你喜欢
      • 2011-06-13
      • 2010-11-30
      • 2012-02-01
      • 1970-01-01
      • 2012-09-30
      • 2013-10-30
      • 2011-07-02
      • 2013-02-10
      • 2014-01-27
      相关资源
      最近更新 更多