PDA

View Full Version : cPanel and SSH problem



iBrightDev
July 9th, 2007, 02:27
anyone else with a dedi and cPanel having trouble connecting SSH. if so, did you fix the problem? Please IM me on MSN

i used to be able to connect to my server with SSH via PuTTY, and now, i cant ever get a connection. i tried to repair the SSH through WHM, and that got me know where, and I even tried rebooting the server. so, I am not sure what else to try. I am still pretty new and clueless to SSH and PuTTY.

Thanks in advance for any help.

sep
July 9th, 2007, 02:47
What OS?

iBrightDev
July 9th, 2007, 13:21
fedora red hat

[ih]Demetris
July 9th, 2007, 18:24
Did you make any changes to your firewall config? If so you may want to start there..

iBrightDev
July 9th, 2007, 19:50
i havent made any changes

when i tried to mess with the SSH keys, it errors and says it cant find file user/bin/.../puttygen.exe

sep
July 9th, 2007, 20:37
You can download the puttygen.exe file from the putty website:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

iBrightDev
July 10th, 2007, 09:56
yeah, i know i can, but, if i cant sign in to ssh, it still does me no good. tried that already. :(

sep
July 10th, 2007, 21:51
Maybe this might be of help:
http://www.php-mysql-tutorial.com/qna/detail/php-execute-shell-command.php

iBrightDev
July 11th, 2007, 02:12
thanks for that, but, i really dont know how to work in SSH, so, executing with php may not be the best idea for me right now. :( i really would just like to be able to connect with putty again. i am going to talk to my server guy and see if he can fix it. i really should just hire him full time to monitor it. might save me some big headaches.

sep
July 11th, 2007, 04:11
Well, you said it's a cPanel server. And cPanel has this /scripts directory that has a few good fixing scripts in there, you could execute them. But ye, I reckon getting someone to manage it for you is the way to go.

iBrightDev
July 11th, 2007, 09:31
looks like i have a phone call to make then. thanks sEp

Decker
July 11th, 2007, 10:42
I don't see where WHM/cPanel would interfere (normally), an SSH connection (SSH2 I hope) using a properly config'd client is a snap.

Not a user of putty but have you got the port number right?

krakjoe
July 11th, 2007, 12:04
Open putty, slide open "Connection" in the left hand treeview, select "Auth", make it look like this ...

http://krakjoe.com/temp/mct/putty-1.png

Click "Session" right at the top, make it look almost like this .... ( obvious difference )

http://krakjoe.com/temp/mct/putty-2.png

From there you should try a login, ( if you changed anything that is ) ....

If the login fails as root, then ....

Open your WHM and under "Account Functions" select "Manage Shell Access", enable a normal shell on a normal users account ( one of yours obviously ), see if you can login with that username / pass .....

Before I continue, did you fix it yet ???

Darknight
July 12th, 2007, 04:15
is ssh running??? if you can find out if its even running thats a good place to start.. kinda hard without ssh though lol... If ssh isnt running and you cant fix it with cpanel... You have broke the server a tech might be able to hook a monitor up to it and fix it otherwise you may need to reinstall the OS (Only if ssh is broken though) I once broke ssh :(

krakjoe
July 12th, 2007, 07:14
To determine if SSH is running on your machine you can open a connection with pretty much anything, if you can open a normal connection you should be able to authenticate yourself with a password .... if you cannot, there is something wrong, either client or server side with your login process - if putty is trying to use keys you may not know if a connection is negociated if authentication fails because it's non-interactive ....



<?php
define("SERVER", 'hozter.info');
define("PORT", 22 );

if( @fsockopen( SERVER, PORT, $errno, $errstr, 5 ) )
{
printf("Connected to a service on port &#37;d @ %s\r\n", PORT, SERVER );
}
else
{
printf("Cannot connect to %s:%d, error number %d reported\r\n", SERVER, PORT, $errno );

if( $errstr )
{
printf("System error : %d : %s\r\n", $errno, $errstr );
}
}
?>

Richard
July 12th, 2007, 07:30
krakjoe,

Quick question, can you log into and send commands to SSH in PHP? :D

sep
July 12th, 2007, 08:03
http://php.net/shell_exec

krakjoe
July 12th, 2007, 08:30
krakjoe,

Quick question, can you log into and send commands to SSH in PHP? :D

http://uk2.php.net/ssh2

There is a prebuilt set of functions to deal with secure shell connections.

If you can't install that for whatever reason depending on the task there is no reason that php cannot negociate it's own connection without those functions using just sockets.....

iBrightDev
July 12th, 2007, 18:06
thanks for all the input guys, and krak, thanks for the script. i actually talked to one of the tech guys at wowrack, where my dedicated server lives, and he asked if i was connecting to the right post. i told him i was trying to connecting to post 22. he then told me that i need to connect to post 3679. i guess the guy that was monitoring my server before had changed it to make it more secure, and just decided not to tell me, so, i wasnt able to connect anymore. now that i know the port was changed, i can log in again. so, thanks again for the feedback.

problem fixed
mods, please close thread.

Decker
July 12th, 2007, 20:23
Nice of them to let you know MT LOL, glad it's fixed now :)

jasontd101
July 16th, 2007, 14:32
Yea, if you had tried a telnet form your local computer on the port SSH or any other program you are trying to connect to it may help resolve the problem.

From your windows dos prompt try the following:

telnet your.server.ip 22

it should return something like this below and if it does not open a connection then the service is not running or the port number is wrong.

SSH-1.99-OpenSSH_3.9p1

iBrightDev
July 16th, 2007, 21:11
the port is not 22, and like i stated before, the problem is resolved. thanks for the info though

mods, once again, please close the thread.

RadixHosting
August 29th, 2007, 19:26
http://uk2.php.net/ssh2

There is a prebuilt set of functions to deal with secure shell connections.

If you can't install that for whatever reason depending on the task there is no reason that php cannot negociate it's own connection without those functions using just sockets.....

Eh? Been using PHP for 5 years now, didn't know those functions existed :D Thanks for the info.

Decker
August 30th, 2007, 05:27
Eh? Been using PHP for 5 years now, didn't know those functions existed :D Thanks for the info.

:lol: Didn't you know *Joe is truely the son of ... better stop there before I offend :angel:

* quote - John Wayne (as Centurion at crucifixion (http://www.imdb.com/title/tt0059245/quotes)) in 'The Greatest Story Ever Told' - in just the same accent that romans would have used :lol: