Alfresco忘了管理员登录密码如何处理

 

 

 

官网找到的,Alfresco的加密方法为MD4,
Alfresco Version 3.1sp1

For an Alfresco 3.1sp1 system, use the following instructions:

1) Run the following commands and check you have only one row in the output:

SELECT anp1.node_id,
  anp1.qname_id,       
  anp1.string_value       
  FROM alf_node_properties anp1  
  INNER JOIN alf_qname aq1 ON aq1.id = anp1.qname_id                          
  INNER JOIN alf_node_properties anp2 ON anp2.node_id = anp1.node_id       
  INNER JOIN alf_qname aq2 ON aq2.id = anp2.qname_id                          
  WHERE aq1.local_name = 'password'    
  AND aq2.local_name = 'username'       
  AND anp2.string_value = 'admin'

It should output the current md4 hashed password for the 'admin' user. An example output is:

+---------+----------+----------------------------------+
| node_id | qname_id | string_value |                     
+---------+----------+----------------------------------+
| 4 | 10 | 209c6174da490caeb422f3fa5a7ae634 |                
+---------+----------+----------------------------------+
1 row in set (0.00 sec)

2) If you get only one row, then update the table:

UPDATE alf_node_properties  
 SET string_value='209c6174da490caeb422f3fa5a7ae634'
 WHERE  
 node_id=THENODEIDABOVE
 and
 qname_id=THEQNAMEVALUEABOVE

Where you need to replace THENODEIDABOVE and THEQNAMEVALUEABOVE with the results from step 1), in this example 4 and 10 respectively.

Note: Please use caution when running this SQL, and ensure that you have the appropriate AND conditions in the UPDATE query.

Alfresco Version 1.4

For Alfresco 1.4, use the following instructions:

UPDATE alf_node_properties
SET string_value = '<MD4 hash here>'
WHERE qname = '{http://www.alfresco.org/model/user/1.0}password'
AND node_id in (
  SELECT node_id  
  FROM alf_node_properties  
  WHERE qname = '{http://www.alfresco.org/model/user/1.0}username'  
  AND string_value = 'admin'  
);
  1. Note the MD4 hash for password 'admin' is
    209c6174da490caeb422f3fa5a7ae634
  2. Note the MD4 hash for password 'test' is
    0cb6948805f797bf2a82807973b89537

 

Alfresco Version 1.3

For Alfresco version 1.3, use the following instructions:

You can use this to get the hash for current admin password:

select string_value  
  from alf_node_properties p, alf_namespace ns, alf_qname q
 where p.qname_id = q.id
  and q.ns_id = ns.id  
  and ns.uri = 'http://www.alfresco.org/model/user/1.0'    
  and q.local_name = 'password'    
  AND node_id in (  
  SELECT node_id  
  FROM alf_node_properties p, alf_namespace ns, alf_qname q  
  WHERE p.qname_id = q.id  
  and q.ns_id = ns.id    
  and ns.uri = 'http://www.alfresco.org/model/user/1.0'    
  and q.local_name = 'username'    
  AND string_value = 'admin'    
);

And, you can use this to set the password:

UPDATE alf_node_properties p
SET string_value = '<MD4 hash here>'
WHERE p.qname_id = (select q.id from alf_qname q, alf_namespace ns  
  where q.ns_id = ns.id                    
  and ns.uri = 'http://www.alfresco.org/model/user/1.0'                      
  and q.local_name = 'password')                      
AND node_id in (
  SELECT node_id  
  FROM alf_node_properties p, alf_namespace ns, alf_qname q  
  WHERE p.qname_id = q.id  
  and q.ns_id = ns.id    
  and ns.uri = 'http://www.alfresco.org/model/user/1.0'    
  and q.local_name = 'username'    
  AND string_value = 'admin'    
);

 

Alfresco versions lower than 1.3

For Alfresco versions lower than 1.3, set the password in the database using the MD4 hash. For example:

UPDATE node_properties  
SET string_value = '<MD4 hash here>'
WHERE qname = '{http://www.alfresco.org/model/user/1.0}password'
AND guid = (
  SELECT guid     
  FROM node_properties     
  WHERE qname = '{http://www.alfresco.org/model/user/1.0}username'   
  AND string_value = 'admin'   
);
 

How to generate the correct MD4 hash

The following class will allow the generation of the correct MD4 hash.

You will need the following jars:

  • cryptix-jce-provider.jar
  • commons-codec-1.2.jar

 

public class MD4HashGenerator  
{  

 static     
 {     
 try         
 {         
 MessageDigest.getInstance("MD4");             
 }         
 catch (NoSuchAlgorithmException e)         
 {         
 Security.addProvider(new CryptixCrypto());             
 }         
 }     

 public MD4HashGenerator()     
 {     
 super();         
 }     

 /**     
 * @param args      
 */      
 public static void main(String[] args)     
 {     

 System.out.println("Hash: " + new String(Hex.encodeHex(md4(args[0]))));         

 }     

 private static byte[] md4(String input)     
 {     
 try         
 {         
 MessageDigest digester = MessageDigest.getInstance("MD4");             
 return digester.digest(input.getBytes("UnicodeLittleUnmarked"));             
 }         
 catch (NoSuchAlgorithmException e)         
 {         
 throw new RuntimeException(e.getMessage(), e);             
 }         
 catch (UnsupportedEncodingException e)         
 {         
 throw new RuntimeException(e.getMessage(), e);             
 }         
 }     

}
"admin"对应的MD4值为“209c6174da490caeb422f3fa5a7ae634”

转载于:https://my.oschina.net/u/574158/blog/1925160

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您好!我是 C知道,很高兴为您解答有关 Alfresco 的安装问题。 要安装 Alfresco,您可以按照以下步骤进行操作: 1. 确保您的系统满足最低要求:Alfresco 支持 Windows、Linux 和 macOS。请确保您的系统符合官方的硬件和软件要求。 2. 下载 Alfresco 安装程序:您可以从 Alfresco 官方网站上下载适用于您的操作系统的安装程序。 3. 运行安装程序:运行安装程序并按照提示进行安装。您可能需要提供一些必要的配置信息,例如数据库的连接参数、管理员账号等。请确保您提供的信息准确无误。 4. 配置数据库Alfresco 使用数据库存储数据。在安装过程中,您需要选择一个支持的数据库,并提供相应的连接信息。常见的选择包括 MySQL、PostgreSQL 和 Oracle。 5. 配置存储:您需要选择一个用于存储文档和内容的位置。可以选择本地文件系统或者其他支持的存储后端。 6. 完成安装:完成上述配置后,继续按照安装程序的指引完成安装过程。 7. 启动 Alfresco:安装完成后,您可以启动 Alfresco 服务。根据您的操作系统,可能需要手动启动或者配置为自动启动。 这些是基本的安装步骤,具体的安装过程可能会因为您的操作系统和版本而有所不同。我建议您参考 Alfresco 的官方文档或者安装指南,以获得更详细和准确的安装说明。 希望这些信息对您有所帮助!如果您有任何其他问题,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值