[19. April 2013] A-400 Advanced Network Setup now available | [11 Jan. 2013] Customize your A-400 Home Screen

Firmware: A-400 [13 May 2013] | C-300 [30 Nov. 2012] | A-300 [30 Nov. 2012] | C-200 [21 Jan. 2013] | A-200/A-210 [10 Aug. 2012]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Thread Closed 
users, permissions and security: Executing aMule without "root" user
12-29-2008, 12:53 AM (This post was last modified: 12-30-2008 12:09 AM by empatico.)
Post: #1
Photo users, permissions and security: Executing aMule without "root" user
Hi all.

I'm concerned about the users, permissions and security on unix-like systems and specially on my PCH. Usually i run gnu/linux on my computer, but i don't know how to set up users and permissions properly because ubuntu do it for me (damn user friendly distros ^^). Now i try to set up users and permissions on my PCH but i'm confused.

When i type "vi /etc/passwd" i see "guest" is the default non root user:
[Image: 9f72d7d39b1512608ea6d8010b9d2325o.jpg]

also i see "nmt" is the owner of barely all the documents and folders from "/share", including those who i created via samba:
[Image: d95a8d752d636e1e9785c3f93f4e75b0o.jpg]

I want know wich user from the users list i should use to run the programs i installed inside my PCH (as midnight comander, iperf, ... ) if i don't want to use the root account.
Specially i want know how run amule and transmission without the root account for security reasons. Also, wich way do you recommend if i want run those apps automaticly every time i reset my PCH?
Find all posts by this user
12-29-2008, 04:36 AM (This post was last modified: 12-29-2008 04:43 AM by lordy.)
Post: #2
RE: users, permissions and security
Ideally The applications themselves should have a configuration option to switch user from root to another user.
Double check with the ps command

Files on the internal H should be created under the NMT account.

I sometimes do

Code:
chown -R nmt:nmt /share/.

after a telnet session to make sure ownership is correct. This doesnt take too long as there are usually not too many files on a hard drive dedicated to holding large media files.

Another approach is to run the command as the nmt user in the first place.

The following command will start a new interactive shell under the nmt account...

Code:
su nmt -s /bin/sh

And the following command should execute a single command under the nmt account...

Code:
su nmt -s /bin/sh -c "command and options in quotes"


Although this will have problems if the command has arguments that have spaces.
In which case start a shell first.

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
12-29-2008, 01:41 PM
Post: #3
RE: users, permissions and security
Thank you, now i see it clearer.

I really knew su, chmod, and those all commands.

I will use "chown -R nmt:nmt /share/" to make sure ownership is correct as you said.

Now i understand i should use nmt account because is the owner of all "/share". I will try run amule with nmt user and i will watch if it work properly.

I don't know if i could run transmission as nmt user, because it runs automaticaly on every startup but i will try.
Find all posts by this user
12-29-2008, 03:18 PM (This post was last modified: 12-29-2008 03:23 PM by empatico.)
Post: #4
RE: users, permissions and security
Midnight Comander works fine with the nmt account, now i won't edit or delete the root stuff by mistake. Iperf works fine too. Perhaps i have problems with aMule.

i changed the owner of all the files needed for run amule:

/mnt/syb8634/etc/amule.sh
[Image: 05d75c6efde102165c6b14ab1cedf3afo.jpg]

/mnt/syb8634/bin/amuled
/mnt/syb8634/bin/amulecmd
/mnt/syb8634/bin/amuleweb
[Image: 91ed63fb868982db977a32126ed9dfdco.jpg]

Also i changed the owner of all the files inside "/share/.aMule" folder:
[Image: 5a4c882722eca10d94e84986408f5fc9o.jpg]

When i run the script "amule.sh" with the "nmt" account, i see the program can not start because the path "/home/nmt/.aMule". I can not find these path, also i think the correct path should be "/share/.aMule":

[Image: 29f19edcea687b5ff2ed33ed40b6dcf1o.jpg]

I'm not sure if the solution it's creating the path "/home/nmt/.aMule" with the root account and then changing the owner of the path to "nmt" user.
Then i can move all the files inside "/share/.aMule" to "/home/nmt/.aMule" and then run amule.sh script. Of course i will keep "/Temp" and "/Incoming" folders inside "/share" folder.
Find all posts by this user
12-29-2008, 04:51 PM (This post was last modified: 12-30-2008 02:26 AM by lordy.)
Post: #5
RE: users, permissions and security
(12-29-2008 03:18 PM)empatico Wrote:  When i run the script "amule.sh" with the "nmt" account, i see the program can not start because the path "/home/nmt/.aMule". I can not find these path, also i think the correct path should be "/share/.aMule":

It's looking for the nmt users home folder.
I'd be wary of adding a home folder for nmt user because it may affect other applications or other parts of the nmt configuration. There may be no problem, but you never know.

amule should have start up option to allow alternate location for the ~/.aMule folder (I guess the existing installtion was already using this option to avoid using the root home folder)

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
12-29-2008, 05:24 PM (This post was last modified: 12-29-2008 05:42 PM by empatico.)
Post: #6
RE: users, permissions and security
I understand what you say.

The amule.conf file have the OSDirectory option. I tried with "OSDirectory=/share//.aMule/" and "OSDirectory=/.aMule/", but amule still search the "/home/nmt/.aMule" path.

I think that don't work because amule can't find the amule.conf file inside /share/.aMule/ path. Now i'm really confused. How could i say amule where find the amule.conf file?
Maybe another solution it's create a new user just for execute amule.sh. this user should have the correct home path: /bin/true or whatever

I'm giving you a lot of work, but i hope this will be usefull for those who have low posix skills, like me.
Find all posts by this user
12-29-2008, 10:18 PM (This post was last modified: 12-30-2008 02:25 AM by lordy.)
Post: #7
RE: users, permissions and security
(12-29-2008 05:24 PM)empatico Wrote:  I understand what you say.

The amule.conf file have the OSDirectory option. I tried with "OSDirectory=/share//.aMule/" and "OSDirectory=/.aMule/", but amule still search the "/home/nmt/.aMule" path.

I think that don't work because amule can't find the amule.conf file inside /share/.aMule/ path. Now i'm really confused. How could i say amule where find the amule.conf file?
Maybe another solution it's create a new user just for execute amule.sh. this user should have the correct home path: /bin/true or whatever

I'm giving you a lot of work, but i hope this will be usefull for those who have low posix skills, like me.

Hi , I'm not too familir with the amule setup, perhaps if you re-post with amule in the title someone could help out.

Creating a new user could work , but I suspect the user would have to be re-created at reboot. I think if someone could helpout on finding .amule conf under nmt user that would be the way to go. Or ask the person who ported it, if there is any simple way to run as the nmt user.

Good luck Smile

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
12-30-2008, 12:14 AM
Post: #8
RE: users, permissions and security: Executing aMule without "root" user
Title edited. Thank you for your help. I will keep working because i'm learning and it's funny.
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  User apps randomly stopping prem1er 2 789 11-26-2012 05:33 PM
Last Post: Djiest
  help with lundFTPD security Slevin 0 462 01-04-2012 01:18 AM
Last Post: Slevin
  NetworkMounter and user name lucky55luc 0 1,004 08-30-2011 08:12 AM
Last Post: lucky55luc
Bug Executing a script on the server from the NMT? johnk 6 3,212 02-21-2011 10:59 PM
Last Post: johnk
  Disable amule daemon drunkendonkey 0 1,449 02-04-2011 12:33 AM
Last Post: drunkendonkey
  amule uninstall bettlejuice 0 988 10-28-2010 08:38 PM
Last Post: bettlejuice
  Question about root.cron pbusardo 1 1,175 10-26-2010 08:54 PM
Last Post: halfelite
  FTP permissions 000 diderikfrom 6 3,283 08-25-2010 06:17 PM
Last Post: infinite.recursion
Information aMule 2.2.3-2 build for NMT Popcorn Hours [updated 3/31/2009] empatico 59 35,245 03-01-2010 06:19 AM
Last Post: fancyboy2k
  [A-200] Firmware Location/User Manual Needed mulder 4 2,475 01-25-2010 08:30 PM
Last Post: michael1t

Forum Jump: