Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hello,

I have been successfully using this library for some time now with one cloud vendor, but no matter what I do I can't get it to work with ec2. SSH'ing in terminal with the same private key/user works without problems. I can't figure out how to debug further -- is there a verbose flag to help me understand why this isn't working, or are there any suggestions on how else i can debug this?

Here is my code, for reference.

	Logger::warn('generating new SSH Client');
	$privateKeyPath = __DIR__ . '/../folder/remote_bash_scripts/id_rsa';
	$key = PublicKeyLoader::load(file_get_contents($privateKeyPath), $password=false);
	$ssh = new SSH2($targetHost);
	if (!$ssh->login('root', $key)) {
	    throw new \Exception('Login failed');
	}
You must be logged in to vote

Replies: 1 comment

Comment options

Can you post the SSH2 logs? You can get them by doing define('NET_SSH2_LOGGING', true) at the top and echo $ssh->getLog() after $ssh->login() fails.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.