PHP Block Shell Scripts On User Accounts

Apr 15, 2007

Is there any way to totally block php shell scripts on users accounts, i don't mean like the java shell in cPanel i mean a php shell script like the kind frequently used by hackers...

View 11 Replies


ADVERTISEMENT

Bandwidth Quota For Shell Accounts ?

Dec 16, 2008

how can setup a monthly bandwidth quota for unix users ? Is there any tool that can measure the in/out bandwidth for all /home/* directories ? For eg if a user wget a file of 150mb , i should be able to track it. I want also to track bandwidth for a user, using dynamic port forwarding via putty.exe.

View 5 Replies View Related

How To Execute Shell Scripts As Some User

Nov 18, 2007

I'm trying to write some scripts that automate the installation of a website with a content management system. This includes creating domains, installing databases etc via plesk API.

Now we have it creating the domains and databases via plesk, this is not the issue. It's permission problems issuing commands on the server.

I need to have the script install the cms and this requires writing files to a folder on the server owned by a user which is created with the domain.

e.g.
user creates timsdomain.com with ftp user name tim
Plesk makes directory on webserver called ~/vhosts/timsdomain.com/
inside this directory is a folder called httpdocs.
All the files within this folder are owned by tim.

Now my script (running as 'apache' in a folder owned by 'admin') needs to write/edit files to this directory as the user tim (or whatever user was created when the domain was set up).

How can I do this from a php script?

My idea would be to log in as the new user and then start issuing commands but I don't know how to login a user from a script.

I've tried exec, exec_shell etc
trying to log in via script as the new user using sudo/su/suid etc but they all ask for a password (for obvious reasons) but I cannot see a way to send the password to the command with the script. Ssh?

Here's some pseudocode that demonstrates what I'm trying to do, if you can think of a better way I'm all ears.

Code:
//User Fills in CMS/Domain information which becomes Form_Data

//uses plesk to create blank domain, create email addresses and empty database
Make_Domain(Form_Data) {
Plesk = Get_Plesk_Object();
Plesk.Create_Domain();
Plesk.Create_Database();
Build_CMS(Form_Data);
}

//HERE IS WHERE I AM HAVING TROUBLE: I can't figure out how to change the user so I can install files to a
// different directory other than the current user's directory (admin)

Build_CMS(Form_Data) {

change_to_user(Form_Data.ftp_username, FormData.ftp_password);
unpack_CMS_archive_into(user_directory); //eg unpack cms.tar into 'timsdomain.com' (if the above command didn't switch the current directory to users home directory)

//initialises CMS config files and installs CMS data to database
Run_Install_Scripts_On_Server(Form_Data);
//albeit complex, most important part of script
Confirm_Tim_Is_Awesome();
}

Confirm_Tim_Is_Awesome() {
while (getTim().has_moustache()) {
echo "<em>You're still awesome. </em>";
}

View 14 Replies View Related

Change Mysql User Password Via Shell?

Jun 8, 2005

Anyone know the commands to change a MySQL user's password via ssh?

I found stuff for changing the root password, and tried to adapt it for the user, but it didn't work.

View 12 Replies View Related

Plesk 12.x / Linux :: Set Subscription User Shell Via Xml?

Jul 1, 2015

Is it possible to set the subscription shell option of an subscription via xml api? I see it is possible via cmd "/usr/local/psa/bin/subscription -u {subscription} -shell /usr/local/psa/bin/chrootsh" But how is it possible via xml api?

View 1 Replies View Related

How To Block User-agent / Bot

Aug 7, 2008

There's a bot that's taken to trolling my site. I'd like to block it.

1) Is there a relatively straightforward way through cPanel that I can do this?

2) Failing that, via adding some code to a page on my site (I've seen some code when googling on the 'net, but I'm new to this, and don't even know where such code belongs. As far as I can tell, depending on the bot, sometimes severe measures may need to be taken. However, from my limited reading, it seems that appropriate editing of .htaccess might do it.)

View 6 Replies View Related

Juniper ScreenOS / SSG Block A User Agent

Nov 25, 2008

I have a SSG-320M I manage, and would like to know if I can block traffic to our web servers based on the user agent hitting us? I know user agents that keep using more and more IP addresses to crawl us, one already taking up some 30 or 40 addresses under my policies and its a pain to identify these by hand and keep updating the firewall every few days to add new IP addresses for them. Is there somewhere I can add part of the user agent I do not want to ever see again? Right now I do this by having a policy at the top saying "BadBotsGroup" is denied. But I want to deny anyone with a user agent "OneUserAgent" or "SecondUserAgent"

It seems so important and simple, but I do not see anything about being able to do this. Thanks for help and pointers. Right now we have special code at the top of our sites that blocks these bots, but I would much rather do it in one location at the firewall.

View 3 Replies View Related

Mod_rewrite Rule To Block User Agent

Dec 17, 2008

how can i block this user agent through mod_rewrite
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
and is this agent will affect all the IE 6 users ?
and whats is the difference between the one above and this one :
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)?

View 7 Replies View Related

Exim Sda7: Write Failed, User Block Limit Reached

May 23, 2009

i have run exim -qff from SSH then i got below error let me know what to do

Code:
root@web [~]# exim -qff
sda7: write failed, user block limit reached.
sda7: write failed, user block limit reached.
sda7: write failed, user block limit reached.

View 4 Replies View Related

Blocking Perl In User Accounts

Nov 26, 2008

I would like to dissable from executing perl scripts on user accounts.

For example,now user can upload perl script for example with name script.pl:

Code:
#!/usr/bin/perl -w
print "Hello World!";
I would like to block it via mod_security - I don't want to allow running perl scripts with .pl extension at all. Is it possible for Apache 1.x?

View 1 Replies View Related

Apache :: FTP Accounts And User Permission?

Feb 20, 2014

My apache VPS is having a minor problem.

Using SSH, I gave permission to my FTP username with code below:
chown -R user:ftpgroup /home/site

But my WP theme needs to set up that user I use is rewritable and use this code:
chown -R www-data:www-data /home/site

since using a php code to check WP user and it shows www-data.

MY PROBLEM: I need my FTP to able to write cause i use plugin to create backup and change plugin. My theme also need for both to work.

I can't seem to make run together. I can change group or FTP as long as I can have m WP working.

View 2 Replies View Related

Disk Quota Not Working For User Accounts

May 5, 2009

I am having Virtuozzo vps with cpanel/WHM installed.I have created some accounts in it by setting disk quota . Now the issue is : some users are using space over the allocted one ,when i use the command quota -u (username),i can see that the users are used the space over the allocated one and they are still allowed to upload file . How to fix this issue ?

View 6 Replies View Related

Cpanel Not Allowing Access To User Accounts

Jul 11, 2008

On a new server we have running CPanel, we have manually created a user account and when i try and log into mydomain.com/whm with that username/password it doesn't let me.

Now my second thought is that I should be logging into mydomain.com/cpanel rather than mydomain.com/whm but I get a 404 for /cpanel.

If i'm logged in as root, i cannot transfer into the user account cpanel either...

View 5 Replies View Related

Plesk 12.x / Windows :: Additional FTP Accounts 530 User Cannot Log In - Home Directory Inaccessible

Jul 10, 2014

I don't know why, but only one server with Plesk 12 if i create additional ftp accounts not working. i receive error:

530 User cannot log in, home directory inaccessible.

If i use principal FTP account works fine.

View 5 Replies View Related

Change Jail Shell To Normal Shell

Jul 8, 2008

Do any1 know how to change jail shell to normal shell?

View 14 Replies View Related

Transfer Accounts To New Server - Unlimited Quota In All Accounts

Jul 17, 2007

Transfer accounts to new server - unlimited quota in all accounts.

I trying

Code:
quotaoff -av
quotaon -av

/scripts/updatenow
/scripts/initquotas
/scripts/fixquotas

Code:
[root@serwer /]# /scripts/updatenow
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Running updatenow manually may cause /scripts to become
out of sync with the cPanel installation. This can cause
a variety of problems.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Code:
[root@serwer /]# /scripts/initquotas
Warning virtual file systems are mounted. Quota's may be counted as double for users who are currently logged in. Please have jailshell users logout before running quotacheck in the future! All jailed users will be logged out in 60 seconds!
Broadcast message from root (Tue Jul 17 19:47:41 2007):
Warning! The system is about to perform quota maintenance. All users will be
logged out in 60 seconds. PLEASE Do not log back in for 30 minutes, or you may
inadvertantly disable your account.
jailshell: no process killed
Quotas are now on

Code:
[root@serwer /]# /scripts/fixquotas
Installing Default Quota Databases......Done
Warning virtual file systems are mounted. Quota's may be counted as double for users who are currently logged in. Please have jailshell users logout before running quotacheck in the future! All jailed users will be logged out in 60 seconds!
Broadcast message from root (Tue Jul 17 19:49:17 2007):
Warning! The system is about to perform quota maintenance. All users will be
logged out in 60 seconds. PLEASE Do not log back in for 30 minutes, or you may
inadvertantly disable your account.
No filesystems with quota detected.
Resetting quota for adamkaro to 1024 M
No filesystems with quota detected.
Resetting quota for adammore to 1024 M
No filesystems with quota detected.
Resetting quota for adamna to 1536 M
No filesystems with quota detected.
Resetting quota for adasmp3 to 1024 M

View 14 Replies View Related

Redirect Domain/user To User.domain ONLY IF Folder 'user' Doesn't Exist

May 7, 2007

I thought I knew enough about my .htaccess stuff to do this, but I can't seem to work it out. What I want to do is if a user visits domain.com/folder, we check to see if the folder exists. If so, show as normal (IE domain.com/support)

If a user visits domain.com/dynamicusername (dynamicusername is not a physical folder), redirect to dynamicusername.domain.com

View 3 Replies View Related

All Reseller's Accounts Showing Under Root When I Click "Show Reseller Accounts"

Aug 2, 2008

We have about 3 resellers on one server and all of a sudden, when I log in to whm and click "Show Reseller Accounts", all accounts show under root.. What's even strager, is that under package colum, it says "undefined"

However, when I click "list accounts", all accounts show and they are properly setup up with the correct package and owner (not all root.. They also show to which reseller they belong).

how to fix the problem when I click "Show Reseller Accounts"?

View 3 Replies View Related

Plesk Automation :: Login As User From Admin / Actual Login As User Are Different

Jan 3, 2014

when I find the subscription from the admin side of PPA, if I select "Login as user" I've noticed that it is different from actually logging in as the user - for example - "add domain alias" is missing when I login as a customer - but not as an admin... I need my customers to add their own aliases and manage them - how do I add that feature to the client login side?

View 9 Replies View Related

Shell

Sep 30, 2007

my server in under attack of shell

how can i find shell code in my server? (c99 ...)

is any anti virus or open source tools to find it

how can i disable shell function?

View 4 Replies View Related

Shell Allow.

May 10, 2007

I have spare dedicated machine.

I want to allow user to run few processes on machine (debian etch).

I configurated limits at /etc/security/limits.conf for group "shell".

When I attached user to group shell, limits work well, but he still can look
everywhere on system. (he can do cat /home/somefile.txt, even owned by root).

Is there any method, software to limit user to acces only their home directories?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved