Menu

Login into WinSCP using ssh key

Please follow the below steps to configure your WinSCP session using ssh(Secure Shell) key.

Create a new session in WinSCP. Select File Protocol and put Host name(IP address) and your ssh User name. Don't put anything in the Password field. Below is a screenshot for reference.


Click on Advanced, then go to SSH >> Authentication



In the Private key file area, click on the browse option and select your .ppk (private key) file. WinSCP accepts only ssh keys generated via Putty but if you generated your key using OpenSSH don't worry WinScp will automatically convert your file in the required format after showing you a warning message. 


For more, you could refer following documents

1. https://winscp.net/eng/docs/guide_public_key#winscp

2. https://docs.oracle.com/cd/E19509-01/820-3503/ggbgc/index.html

Bundle is NOT whitelisted in AEM

While using the loginAdministrative() method of SlingRepository class you might see an error "Bundle is not whitelisted". To get this method work we have to whitelist the bundle in OSGi configuration "Apache Sling Login Admin Whitelist" this helps us to defines which bundles can use SlingRepository.loginAdministrative().

Below is the code snippet of creating session using loginAdministartive method.

@Reference
private SlingRepository repository

Session session = repository.loginAdministrative(null);




How to get list of components in AEM?

We can get the list of components based on the project path or component group in AEM. SQL Query is powerful to filter out the component nodes and this can be easily used in the query tool of crx/de and export the results in a spreadsheet.

Below is the JCR-SQL2 query to get the list of all the components in AEM. 

SELECT * FROM [cq:Component] AS s WHERE [componentGroup] IS NOT NULL AND ISDESCENDANTNODE([/apps/aem-sample-project/components])

AEM query tool to run the SQL query to find and get nodes
AEM Query Tool