cancel
Showing results for 
Search instead for 
Did you mean: 

Finding path on CCGI

ratbag
Grafter
Posts: 369
Registered: ‎01-08-2007

Finding path on CCGI

Hello,
I've been going round in circles this evening, following links and reading plusnet guides that didn't work.
I want to find the path to my home directory (if that's the right term) on the CGI (or CCGI if you prefer) server. The guides I've tried involving tenet and putty just didn't allow me to connect at all.
Supplementary question: how can I change my CGI login password? Again, telnet and putty didn't let me connect.
I thank thee for any help.
Barry.
22 REPLIES 22
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Finding path on CCGI

Telnet and SSH access to ccgi was disabled last August due to a security vulnerability (link). FTP access remains available.
I guess you will need to raise a ticket to get your ccgi password changed.
David
David
ratbag
Grafter
Posts: 369
Registered: ‎01-08-2007

Re: Finding path on CCGI

Thanks David.
How about getting the path to home on the CCGI server, Anyone know?
I thank thee.
EDIT: I just realised, you said they were disabled last August. I think the help tutorials should at the very least have the out-dated sections removed. Anyway...
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Finding path on CCGI

FTP the following PHP program to ccgi

<?php
phpinfo();
?>

make it executable (permissions 0700) and execute it in a browser. The PHP variables shown towards the bottom of the list should provide what you are after.
David
David
ratbag
Grafter
Posts: 369
Registered: ‎01-08-2007

Re: Finding path on CCGI

That's great, thanks David. I wanted to password protect a folder you see.
I used the path starting with:
 /files/home1/...

It worked, so I assume that's okay.
Thanks again,
Barry.
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Finding path on CCGI

Yes, that's the style file paths follow, with 'home1', 'home2', … depending on which storage device your account is assigned to.
Were the tutorials you referred to those on Usertools?
David
David
ratbag
Grafter
Posts: 369
Registered: ‎01-08-2007

Re: Finding path on CCGI

Hello David,
Yes, it was usertools: http://usertools.plus.net/tutorials/id/18
Thanks again,
Barry.
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Finding path on CCGI

Thanks. As a temporary measure I've added a note at the top of that tutorial mentioning that command line (telnet/SSH) access to the server is disabled.
David
David
nac
Newbie
Posts: 7
Registered: ‎29-03-2010

Re: Finding path on CCGI

Hi,
I also have some life-without-ssh questions. I used to use ssh to administer my PERL-based CCGI web-site, specifically to
1/ change file protections
2/ find out where executables live
3/ re-submit my cron file when I changed it.
Since the recent changes to CCGI, my web site has changed location in the PN file space, and stopped working (apart from my nighly cron job which continues to run)
In a life-without-ssh world I learn that I can use ftp to change file protections and a blob of php to find out some environmental information.. but how can I re-submit my cron file?
I read elsewhere about PLESK as an admin front-end, and I understand that can be used for doing cron-related stuff (and therefore can be used to achieve other stuff like my item #2). Is PLESK the answer? I have only seen it mentioned in the context of the PAYH platform, and I am an olde-fashioned CCGI (cshell, free-online) user. If PLESK is the answer, how do I determine what server to log in to?
thanks for any enlightenment..
Neal.
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Finding path on CCGI

Quote from: nac
I also have some life-without-ssh questions. I used to use ssh to administer my PERL-based CCGI web-site, specifically to
1/ change file protections
2/ find out where executables live
3/ re-submit my cron file when I changed it.
Since the recent changes to CCGI, my web site has changed location in the PN file space, and stopped working (apart from my nighly cron job which continues to run)

I'm not aware of any reason why your web site should have changed location. All my files stayed where they were before, with exactly the same permissions.
Reasons for your web site not working might be explained in the Upgrade FAQ (section 6 onwards) in the Community Support Library.
Quote from: nac
In a life-without-ssh world I learn that I can use ftp to change file protections and a blob of php to find out some environmental information.. but how can I re-submit my cron file?
I read elsewhere about PLESK as an admin front-end, and I understand that can be used for doing cron-related stuff (and therefore can be used to achieve other stuff like my item #2). Is PLESK the answer?

Plesk is an administration control panel provided by server administrators. Though provided on PAYH It isn't available on ccgi so is not the answer.
With regard to surviving without shell access.
Bash script files can be executed, for example item #2

#!/bin/bash
echo "Content-type: text/plain"
echo
whereis perl

FTPed to ccgi as (say) bashexample.cgi, made executable (permissions 0700) and called using a browser.
Permissions can be set globally using the script provided by Gabe here which sets different permissions for directories and executable files.
You might be able to use a script to change your crontab (complete replacement?), but that is something I haven't tried. However others would no doubt be interested if that works for you.
David
David
jelv
Seasoned Hero
Posts: 26,785
Thanks: 971
Fixes: 10
Registered: ‎10-04-2007

Re: Finding path on CCGI

The inability to update cron jobs without telnet or ssh was pointed out to Plusnet months ago. There's been no response on that topic other than to say it was being investigated?
jelv (a.k.a Spoon Whittler)
   Why I have left Plusnet (warning: long post!)   
Broadband: Andrews & Arnold Home::1 (FTTC 80/20)
Line rental: Pulse 8 Home Line Rental (£14.40/month)
Mobile: iD mobile (£4/month)
bobpullen
Community Gaffer
Community Gaffer
Posts: 16,869
Thanks: 4,950
Fixes: 315
Registered: ‎04-04-2007

Re: Finding path on CCGI

Access to crontab will not be possible via the conventional methods, although I'm fairly confident you're already aware of this jelv?
I'm not sure if it's possible to use something akin to this which I know Gabe has paid mention to before when I've been chatting with him over PM.
I can't really see why we wouldn't allow crontab modifications via ticket, although we'd need some guidelines to make sure people submitted all of the relevant information. I'll put this suggestion to the Net-Ops Team later on and see what they say...
I'll also look to get something in the FAQ about finding out the path name and how to request password changes etc. Once traffic has died down here, we'll look to port what we've put in the Community Library across to the portal support pages.
Remember, *anyone* can create Community Library articles.
Edit: Have spoken to Networks and am just awaiting the go-ahead that we can make crontab modifications following a request made via the ticketing system. Assuming the process gets signed off then I'll add it to the FAQ as well...

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

nac
Newbie
Posts: 7
Registered: ‎29-03-2010

Re: Finding path on CCGI

David,
thanks for your response. Unfortunately, your suggestions did not work for me (cue emoticons for crying, gnashing of teeth and renting of garments). Here's what I tried:
1. The "test.php" that you posted earlier works fine when I upload it, "chmod 700" it and browse to it. I can put it in my root directory or my cgi-bin directory and both work fine. My cgi-bin directory has a protection of 750.
2. The shell script in various forms (--- spaces the 3 different versions I have tried)
----
#!/bin/bash
echo "Content-type: text/plain"
echo
whereis perl
----
#!/bin/bash
echo "Content-type: text/plain"
echo
echo
echo
---
#!/bin/sh
echo "Content-type: text/plain"
echo
echo
echo
---
I have tried naming this "web_access" and "web_access.sh" with the same results. I have tried putting in in my root directory and in my cgi-bin directory, with equivalent results. Specifically:
- if the protection on the file is 740 (or 755), my browser simply displays the source
- if the protection on the file is 700 (or 705) my browser reports Access Forbidden Error 403
Demo:
http://ccgi.pinga.free-online.co.uk/cgi-bin/web_status.sh --- access forbidden
http://ccgi.pinga.free-online.co.uk/cgi-bin/web_status ; --- does not execute; simply see the source
http://ccgi.pinga.free-online.co.uk/cgi-bin/test.php --- works fine
For the avoidance of doubt. all this was done under Linux with Unix-style line endings etc. I don't think that has any bearing on the matter..
[BTW, my earlier comment about my files having moved was incorrect: the result from test.php shows that they are still in the same place. My confusion was caused by ftp reporting that my login directory was "/" which I now assume to be some kind of chroot jail]
This all leads me to wonder whether the ONLY thing that plusnet now permit on under ccgi is PHP?
Neal.
bobpullen
Community Gaffer
Community Gaffer
Posts: 16,869
Thanks: 4,950
Fixes: 315
Registered: ‎04-04-2007

Re: Finding path on CCGI

Quote from: nac
I have tried naming this "web_access" and "web_access.sh" with the same results. I have tried putting in in my root directory and in my cgi-bin directory, with equivalent results.

have you tried naming it "web_access.cgi"?

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

nac
Newbie
Posts: 7
Registered: ‎29-03-2010

Re: Finding path on CCGI

Quote from: Bob
have you tried naming it "web_access.cgi"?

Aha! That worked. Thanks! Also, my original problem (broken PERL WIKI) was fixed simply by adding .cgi to the filename. As Bob suggested, there is a limit to what you can put in that little shell script:
---
#!/bin/sh
echo "Content-type: text/plain"
echo
whereis perl
whereis crontab
/usr/bin/crontab -l
echo and that is that
---
Displays:
perl: /usr/bin/perl /etc/perl /usr/lib/perl /usr/share/perl /usr/share/man/man1/perl.1.gz
crontab: /usr/bin/crontab /etc/crontab /usr/share/man/man5/crontab.5.gz /usr/share/man/man1/crontab.1.gz
and that is that
so, no messing with cron through this route.
Would it be helpful if I was to summarise all this as an edit to http://usertools.plus.net/tutorials/id/18 ; if so, is that file just raw html (it looks like it) or is it rendered from some other source?
thanks,
Neal