How to set username and password in JBoss - authentication

Unfortunately their Wiki is down for maintenance and the web is not being helpful.
How do I add a new user to JBoss so I can login.
In Tomcat you change the tomcat-users.xml file. There seems to be a similarly located and titled file called login-config.xml in the config folder of jboss.
Is it something to do with this file or something else altogether.

It's in the users.properties file within jboss\server\default\conf\props

Like #Ankur said you need to configure the files in the jboss\server\default\conf\props
I think you want to configure your admin console users. So you have to add one line with your user name and password to the jmx-console-users.properties file (e.g: username=password => jbatista=portuguese).
It's important that you don't forget to add the role to the user created above/privileges. Like tomcat or any other Application server the users have one or more roles and the roles have permissions. In this case we want that the user jbatista has the JBossAdmin role so that he could deploy WARs, etc. Like the add user case, we have to add another entry line. But instead of jmx-console-users.properties we'll add the jbatista=JBossAdmin (username=role) line to the jmx-console-roles.properties file

You can add the user through CLI in Jboss AS 7 which in turn stored in mgmt-users.properties in JBOSS_HOME/domain/configuration & JBOSS_HOME/Standalone/configuration/ directory.
I have an ubuntu system but the step to add the user is same through cli :
Through terminal go to bin directory path of Jboss7
type ./add-user.sh
Then create the type of user which you want.
This link will help you and explain much in details :
http://www.mastertheboss.com/jboss-as-7/adding-users-with-jboss-as-7
Note : for windows you have to run the add-user.bat file instead of .sh

Related

where can i find "pwdAccountLockedTime" in Apache-DS LDAP?

I do right-click and choose "Fetch->Fetch operational attributes" but there is no pwdAccountLockedTime in attribute list. Where can i find pwdAccountLockedTime?
The Apache information is windows Apache Directory Studio(Version: 2.0.0.v20161101-M12)
EDIT : ads-pwdAccountLockedTime hinted that you use Apache Directory Server, the documentation to configure password policy is here
You have to add the objectClass ads-passwordPolicy to be able to use the attributes on your entry
--
Apache Directory Studio is just a client which fetches informations from a directory.
If you want to see the attribute, then the directory must have it stored.
If you get "Warning! According to the schema attribute ads-pwdAccountLockedTime is not allowed." it's probably because you did not include the schema needed for the password policy to work properly or simply did not enabled the password policy (assuming you're using OpenLDAP)
To do so, you need to enabled the ppolicy overlay and configure it correctly, which requires you to add the ppolicy.schema.
See : http://www.openldap.org/doc/admin24/overlays.html and http://www.zytrax.com/books/ldap/ch6/ppolicy.html

I forgot the Glassfish3 master-password, how can i reset it?

I forgot the master-password of my Glassfish 3.1.2.2. Is there a way to reset it? I spent a lot of time "googling around" but i didn't find a suitable answer.
There is a backup password that can be used to access the administrator panel even if you've forgotten the main one.
If you navigate to glassfish\domains\domain1\config\ you will find a file called local-password.
The contents of that file can be used as a password to log in to the control panel as admin.
Please follow the below steps:
Stop the domain
Back up the master password file
Create a new domain and save the master password:
asadmin create-domain --savemasterpassword domain2
Remember the password :-)
Copy the newly created masterpassword file over the old one
Delete the newly created domain:
asadmin delete-domain domain2
FYI, now you should also know why you want to protect the master password file using file permissions :-)
Copy the admin-keyfile from origin install zip (empty password).
This was a big problem for me after inheriting a testing VM from a colleague who left the company. I didn't want to risk creating a new domain as described above and I tried using the contents of local-password file as also described above, but that didn't work for me.
What did work first time was the following on GlassFish Server Open Source Edition 3.1.2.2 (build 5). Change contents of this file:
$GLASSFISH_HOME$\glassfish\domains\domain1\config\admin-keyfile
with:
admin;{SSHA}WQVj8i9CLECCiv+w6ZxGgMrcfPqHPoXZW+2Jdw==;asadmin
I didn't add a newline or carriage return at the end of the line.
This is my modification of an online solution.
For Glassfish 4, after creating domain2 with default passwords, I also had to copy keystore.jks and domain-passwords files along with the master-password before change-master-password would recognise the password.

Rails/Paperclip - Can't see uploaded images

I have a Rails 3 application which has an attachment model and uses Paperclip gem. Everything works fine on development environment but on production server we cannot access any of the images uploaded. The images are in the right folder where they are supposed to be but when I try to reach them on browser I simply get the 404 page.
The upload folder is located under public folder and called "uploads"
I can access this: "app_url/uploads/test.html" which I manually created to see if it works
But I cannot acces this: "app_url/uploads/test.jpg" which I upload within the application via Paperclip.
I can guess this has something to do with the server configuration but I'm not an expert and may need help about it.
Thanks
UPDATE
I've just realised that uploaded files belong to "nobody" and when I manually change the owner to "root" it seems to be working fine. So I need to find a way to tell Paperclip make the files belong to "root"
It's not a good idea to have a web application being able to write files as root. File permissions are derived from the process writing the files. In case you're using Passenger, there's the concept of user switching:
http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerDefaultUser
Upon startup of your app, Passenger tries to figure out which user owns those files, and tries to switch it's application process to that user. In case it fails, "nobody" is the default.
Check your application permissions on the file level. You should have one user account per application on your server. The application (the directory and contents above the public directory) should be owned by this user. Files under public should be readable by others, so the webserver can pick them up, too.
Are you using Capistrano for deployment?

add user to turnkeylinux.org, Trac instance

I'm trying to get up and running on Trac quickly for a pending migration. Could someone tell me how to add new users to Trac. As I understand it trac authenticates against apache, which uses a password file. I know how to use htpasswd but I don't know where the password file is. Am I going down the wrong road here?
Somewhere in your Apache configuration (like mod_python.conf) you'll have a line that specifies where the authentication file is:
AuthUserFile /var/lib/trac/your_auth_file
While you're in looking at that file, look for the base Trac directory. It may be specified as:
PythonOption TracEnv /var/lib/trac/yourProject
Once you've used htpasswd to add them to that file, you'll want to add them to Trac, so you'll need to run trac-admin:
trac-admin /var/lib/trac/yourProject
You can then issue a help command to learn how to add users to trac, etc.
Turns out all I needed to do was use htpasswd in the folder where my track site was. And then I was able to use the admin tool in track to give that user permission in track.

phpbb admin config file

Does anyone know where the config file for the admin is? For instance I want to change the database connection for the admin. I know where the main config file is but is there a separate admin config file with the db connection?
No it is all contained in one config file. Why would you want a separate database configuration for the admin that is not being used by the front end of the application?