Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-14-2012, 06:46 PM   #1
Registered: Oct 2011
Location: ~
Distribution: Debian 7
Posts: 60

Rep: Reputation: Disabled
Program write access to root files

Hi guys, i got a local server, running as PXE Server, with low security priority.

i made my own Linux Booter, with a little fidling with a Linux sysrescue cd.

It really works great, as long you know the right commands.

i used Linux Sysrescue cd, to boot up into busybox (as it normally does), but with a nfs partition, with some tool scripts, to take backup and restore images on the local hdd, and fix hdd UUID, grub, and other network things, and things we need.

currently the command to backup is
/mnt/scripts/install BACKUP TYPE=CTO-Serial

it will then do:
backing up MBR.
backing up all available local drives from /dev.
empty temp files used by yum and apt-get in the images.

now the restore is a but more advance, as it is able to add one-time startup scripts:
restore MBR.
restore all available drives from the archiver file, into /dev.
reinstall grub to make it work again.
rewrite the fstab.
insert the aviable script for this image or mac-addr into the init.d folder, and add them to the startup, as a onetime script.

now my question is pretty simple, but i am just proud of my creation, as i am amazed i was even able to get it this fare, by alot of help from this forum, and for that i am really greatfull

but as i am the only linux geek at my workplace, they really wanted to make it simpler, to add thouse custom scripts to an image.
so i have been developing a java/servlet application, running from a local tomcat7 service, it needs to be able to edit directly into the pxelinux.0 folder, to add custom boot scripts, depending on mac-addr.. si i just added the folders group to the tomcat7 user.

----the question----

now i got a problem that i also need to edit a root:root file, and i really dont want to add the root group to the tomcat7 user, and wondered if there was another way to do that?
Old 11-15-2012, 06:55 PM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,501

Rep: Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411Reputation: 2411
Try sudo, but just make a script that runs from there that they can pass params to.
Don't(!) enable an editor via sudo, as its possible to break out into the root shell being run.
Old 11-15-2012, 07:16 PM   #3
Registered: Oct 2011
Location: ~
Distribution: Debian 7
Posts: 60

Original Poster
Rep: Reputation: Disabled
hmm i dont think i can run sudo trough java, as i dont want any password stored anywhere, in a accessable program.

however i've been thinking of breaking the program up, and add a service started by root, that manage tasks, given by the main part. by let them communicate trough a socket, it seems like the way i need to do it. but thanks for the idea


access, groups, java, tomcat, users

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] to gain write access in root folder ayush15690 Linux - Newbie 9 08-20-2011 06:18 AM
no write access for users, only root. linuxpokernut Slackware 15 11-24-2008 09:01 PM
NFS non root user don't have write access. knockout_artist Linux - Newbie 1 10-10-2008 02:44 PM
Downloading files into root or write files to root RaleighRalley Linux - Newbie 2 07-01-2006 10:56 PM
NFS non root read write access matthewkeen Linux - Networking 8 09-09-2004 10:52 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration