Modify Default admin User

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

Modify Default admin User

Postby wuhaa » Fri Aug 21, 2009 1:29 am

Hi,

I have installed subsonic on my ubuntu server. I want to change the default user "admin" to a different login name (username) while retaining its admin privilege.

I think subsonic uses hsqldb to store this info. Its worth mentioning that I have very little knowledge of Java in general. So I googled for a manager interface fro the db. I found that hsqldb has this sort of built in and it can be invoked with

java -cp hsqldb.jar org.hsqldb.util.DatabaseManager

So the jar file sits in the subsonic/WEB-INF/lib/hsqldb-1.8.0.7.jar and the data file sits in subsonic/db/subsonic.data in case anyone is not aware as I was.

Anyhow I am unable to change this user "admin" as the Management utility does not show any data in that subsonic.data file. I am also unsure what the table names are as "Show Tables;" does not execute.

If anyone has managed to do this, please shed some light as to how to achieve this (preferably from the cli).

Thanks
wuhaa
 
Posts: 14
Joined: Mon Jul 20, 2009 5:45 pm

Postby wuhaa » Fri Aug 21, 2009 3:32 pm

Is this not possible or no one has tried to do this...?

Maybe subsonic developers can comment....
wuhaa
 
Posts: 14
Joined: Mon Jul 20, 2009 5:45 pm

Postby oxide[NL] » Sat Aug 22, 2009 12:54 pm

create a new user with full admin rights ^^
oxide[NL]
 
Posts: 27
Joined: Wed Apr 01, 2009 3:06 pm
Location: holland

Postby wuhaa » Sat Aug 22, 2009 3:16 pm

I know that answer was coming... How do I delete the admin user after I have created the new user with admin rights?
wuhaa
 
Posts: 14
Joined: Mon Jul 20, 2009 5:45 pm

Postby oxide[NL] » Sun Aug 23, 2009 11:36 am

good question, didnt figure that one out yet also
sorry mate
oxide[NL]
 
Posts: 27
Joined: Wed Apr 01, 2009 3:06 pm
Location: holland

Postby jigsaw » Sun Aug 23, 2009 1:15 pm

wuhaa wrote:I know that answer was coming... How do I delete the admin user after I have created the new user with admin rights?


go to http://<YOUR_HOST>/db.view after you've logged in as the new admin user and run this SQL:
Code: Select all
delete from user where username = 'admin'


Keep in mind that many a application has some things which only applies for the user with the name admin. Deleting it could cause some issues for you, so you do it at your own risk :)
Currently without Subsonic due to hardware failure :(
User avatar
jigsaw
 
Posts: 242
Joined: Sat Oct 13, 2007 12:01 pm
Location: Stavanger, Norway

Postby wuhaa » Sun Aug 23, 2009 8:24 pm

Beautiful, that is what I was looking for. This interface can allow for a lot more modifications. Thank you for sharing that.

I do have a followup question to that. Is their a way to execute a command line query in hsqldb (something like java db.view "select *from user")...

By the way, Im running subsonic through tomcat 6

Thanks,
wuhaa
 
Posts: 14
Joined: Mon Jul 20, 2009 5:45 pm

Postby indecline » Sat Jan 08, 2011 10:48 pm

4delete

Code: Select all
delete from user where username = 'admin'


4rename

Code: Select all
UPDATE user SET username='mom' WHERE username='admin'


dosent works

Code: Select all
Integrity constraint violation SYS_FK_51 table: USER_ROLE


thanks !
User avatar
indecline
 
Posts: 33
Joined: Sat Jan 08, 2011 9:25 pm


Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 6 guests