0

I have a dedicated Linux web server with many user accounts on it. The user accounts are all located in /home/[userid] directories. I am able to create Perl scripts that run within each of my users’ accounts that can access files only within their own account, but now I need to create a script that can run “above” the users’ accounts and be able to access a file within any specified user’s account.

Currently, I have a script that uses Net::FTP to retrieve the needed file from each account so I can extract the necessary data from it, but of course, it’s slow to FTP into every account. Since the accounts are merely directories on the server, I’m looking for a way to run a Perl script in a way that it can access each account directory and simply open the required file and return the requested data for the specified account.

How can I accomplish this?

tchrist
  • 78,834
  • 30
  • 123
  • 180
Vinnie
  • 13
  • 1
  • 3
  • 1
    What exactly is your problem here? What issues are you running into when you try accessing the data from a locally run script? (i.e. running on the server) – amon Sep 03 '12 at 19:34

1 Answers1

2

You should login as a user that has access to all the user directories (e.g. root). For security reasons, it might be safer to use sftp or some other encrypted connection.

tchrist
  • 78,834
  • 30
  • 123
  • 180
choroba
  • 231,213
  • 25
  • 204
  • 289