SSH in Engine Yard - ruby-on-rails

I've got some large problems with my ruby on rails deployment on EY. Support has said I need to SSH in to clear the errors... but I get the following:
###########################################################
# WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! #
###########################################################
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
80:4c:5f:dd:98:bb:cb:01:6c:a9:11:41:29:56:66:86.
Please contact your system administrator.
Add correct host key in /Users/jameshughes/.ssh/known_hosts to get rid of this message.
Offending key in /Users/jameshughes/.ssh/known_hosts:1
RSA host key for ec2-184-73-167-153.compute-1.amazonaws.com has changed and you have requested strict checking.
Host key verification failed.
[Process completed]
How do I add the correct key to the Known_hosts file?

Open up known_hosts in your favorite text editor, find the entry for "ec2-184-73-167-153.compute-1.amazonaws.com" and delete the entire line. The next time you ssh in, it will add the correct key to the known_hosts file.
Note that this error is for security purposes, so I'm assuming that you know that there is not a "man-in-the-middle" attack going on and that the server key has actually changed. If it has not, there might be something else going on.

To fix your "Permission denied (public key)" problem, you'll need to add your public key to engineyard via the Tools menu, then apply your changes to your environment (by clicking apply).
Hope that helps.

Update
Please see #womble's comment below and my reply. As #womble notes, if you use StrictHostKeyChecking no you will be open to man in the middle attacks. I've talked with EngineYard about this (last time I checked, StrictHostKeyChecking no was what they were recommending in their help documentation). I believe using StrictHostKeyChecking=ask is a better alternative. Does anyone else know if there is a better solution than using StrictHostKeyChecking=ask?
I ran into the same issue and this seemed to work for me. You just need to add "StrictHostKeyChecking no" to after "'~/.ssh/config'':"
Engine yard has a pretty good article on it. The Man in the middle issue is near the bottom.
http://docs.engineyard.com/ssh-keys-and-configuration.html
Now when I SSH I still get the warning, but am able to access the server. I started getting the warning after I stopped and restarted my instance.

Related

Authentication Failed on SourceTree while cloning BitBucket project

I am trying to clone a project from my bitbucket to my computer, using SourceTree.
I tried to do so from the web interface :
But it always failed.
Here is the details of the error.
Can you help me please ?
Update: As mentioned below an update (1.6.25) has been released which fixes this error.
Original: Authentication in Version 1.6.24 of SourceTree is currently not working well. Use version 1.6.23 instead. You can find it here: http://downloads.atlassian.com/software/sourcetree/windows/SourceTreeSetup_1.6.23.exe
Enjoy:)
Yes, the problem is with Askpass.exe
We recently changed the logging framework we used to slf4net/log4net and this, unexpectedly is being picked up by askpass.exe.
But unfortunately since askpass.exe has no configuration in place it logs some output to stdout by default, this is interfering with the expected stdout output from askpass.exe.
We will release a 1.6.25 tomorrow with a proper fix.
Work Around
As a temporary workaround copying the attached Askpass.exe.config file in to
C:\Program Files (x86)\Atlassian\SourceTree
will provide the necessary configuration and should fix the multiple authentication requests.
You may find that unfortunately SourceTree has deleted what it thought were 'failing' passwords. Apologies for this you will need to re-enter them.
You can see the issue on Atlassian's own Jira: SRCTREEWIN-3944
Edit: Said update appears to be available now.
Help > Check for Updates > Update
Worked for me
It is because of the update which is the Two-step verification. I suggest you read this first to read more about their update and then you proceed over here. I was able to change my default HTTPS protocol to SSH protocol by following the steps above.

Smartgit SHA fingerprint of the certificate does not match

I am trying to install SmartGit and trying to provide bitbucket as hosting provide. I provide correct credentials of my bitbucket account but I get following error:
=======================================
java.security.cert.CerfiticateException: SHA fingerprint of the certificate does not match.
Expected: [some string]
Actual: [some other string]
This may either mean that the server certificate has changed or that you are spoofed.
=======================================
I think this is related to SSL certificate but do not know how to fix it. Any help will be highly appreciated.
From [1]: to fix SmartGit 5.0.7.1 (and older) add following line to smartgit.properties (in the SmartGit settings directory, see About dialog):
smartgit.hostingProvider.bitbucket.sslFingerprint=37:A8:0E:13:87:DA:13:C3:B8:35:6F:84:EF:74:D2:38:B1:AC:59:9B
After restarting SmartGit, connection will work again.
[1] http://blog.syntevo.com/2014/03/09/1394361360000.html
Same problem here. Guess BitBucket changed their key since the latest version got released.
Solution (or rather, workaround)...:
Don't add BitBucket as a remote provider. Add your URL simply per each project.
Remote -> Add
You can find the URL for your projects on the web interface of BitBucket.
Right after you select a project of yours, a link is displayed on the right side of your screen. It starts with https ... That is what you need.
BitBucket just changed their certificates, as announced on their blog.
On March 7th at 22:00 UTC, we’ll be updating our SSL certificates to replace ones that will be expiring soon. It’s likely that you won’t notice any changes and won’t need to take any action.
You can work around it it using the per-project URLs as described in Shiki's answer.
Just add the following line to your ~/.smartgit/5/smartgit.properties
smartgit.hostingProvider.bitbucket.sslFingerprint=7F:E2:6E:8F:0B:7F:3A:CD:6E:02:54:04:03:57:39:BD:D2:4B:CF:AE
Then re-try adding Bitbucket and it should work.
I had this same issue, but for github and adding the fingerprint to smartgit.properties was not working.
What did work was updating to the latest build (last option in the Help menu).

Virtualized Puppet master showing alphanumeric error when trying to load the dashboard

When I try to go to the puppet dashboard it loads up a white page saying
The environment must be purely alphanumeric, not ''
I googled this error a bit but there does not seem to be a finite solution yet. As fast as what I've done I've looked into the conf.d files, but I'm afraid to make the wrong edit. I'm still new to this and was wondering if anyone has ever ran into a similar situation?
This happens if one tries to access puppet console in wrong port (8140) instead of 443, assuming default ports are being used.
This also happens when you install puppet-passenger The opensource.
In this case - everything is OK!
Install Open Source agent and be a Puppet Master :)

Where do I put the files I want to be displayed on my webpage on my webhost?

So I just finished the railstutorial.org twitter clone example and I want to put it online with my web hosting provider bluehost. Right now all I have is a file called sample_app with all of the rails stuff in it. And it works fine when I visit it on localhost:3000.
So I go to my bluehost file manager and there are 9 different folders, like public_html, public_ftp, rails_apps, www, tmp, access_logs, ect. Ive uploaded sample_app into this overall directory and into the public_html directory itself. But when I visit my website it just displays the html in a default.html file in the public_html directory.
What exactly is telling my hosting service to use public_html/default.html of any of the hundereds of different files and folders that are in other places on my server space? How do I find this thing and tell it to instead use sample_app or public_html/sample_app and then process everything in that to display my rails application?
Ive tried using bluehost support and they emailed me and said this would be accomplished by creating a symlink which links ~/rails_apps/NinetyNine/public to ~/public_html. I have no idea how to do this and the guides I find online all tell me to enter a series of commands. I dont know whether to do this in a terminal on my ubuntu system or some command prompt that bluehost provides. If it is at a terminal on my system which directory should I be in? any attempts I have made on my system have resulted in a no such file or directory error. When I asked bluehost to explain this they said that this was outside of the scope of their support and had to do with web development not hosting. It struck me as odd that they were unwilling to explain their own response to my problem but whatever.
If anyone of you could help me or point me in the right direction I would very much appreciate it. Thank you
What is telling my hosting service to use public_html/default.html ?
That would be a setting the web server configuration, probably Apache.
In Apache's case, the public_html directory is usually enabled with the
UserDir directive.
The default.html, is also an Apache configuration, DirectoryIndex.
Answering these because you asked: but typically, the global Apache configuration
is maintained by your provider (though you usually have some means to customize
parts of it).
Create the symlink from public_html to
They like gave you a command like (maybe not exactly)
$ ln -s ~/rails_apps/NinetyNine/public public_html
That is something that is intended to be run on your webhost, from a command prompt,
at the top of your home directory.
Look for docs on bluehost for finding out how to get SSH shell access.
That's where you'll enter the command.
More generally, however, you want to make sure you read the docs on how your
provider wants you to upload applications. Bluehost seems to have very nice
docs here:
https://my.bluehost.com/cgi/help/rails
Why your hosting provided said it was out of scope.
You're a beginner, and that's officially OK. Welcome!
But if you asked them a question like "Do I enter these commands on my computer
or yours", they are definitely going to politely respond that this out of scope;
meaning -- "We can't hand-hold you through this". If you ran a gas station and
someone asked you how to use the pump, you'd tell them. But if they then asked
"OK but do I put the gas in my car or yours?" you'd be reluctant to answer, because
there's some fundamental missing.
So how do I get more pointers, directions on this stuff?
Lots of approaches. By the far the best is to do as much stuff as you can on
your own computer. In your case, you could easily set up your own Apache
(Macs and Linux frequently ship with it - readily installable on Windows), and
that would clear up a lot of the conceptual issues.
Good luck!

How to install s3sync

This seems like an excellent script but lacks a key part to its installation I can't seem to figure out. Maybe someone out there can help a newb.
What I've done so far :
Installed the s3sync package.
Downloaded the s3 certificate
Downloaded the s3 ssl package
ran it with sh ssh.certs.shar
Edited the s3conf.yml file to have the correct AWS id and password and a path to the cert file
When I run the s3cmd.rb I get the error "You didn't set up your environment variables; see README.txt"
To which I agree, there is no information written regarding where I specify destination or target.
Guesses :
-The cert file has to be in a specific place to which it isn't, or its in the incorrect cert file
-the s3conf.yml may not have the correct information written in it.
UPDATE:
Uninstalled everything, and installed it as a gem. Made sure the s3config.yml is still in /etc/s3conf/ . Still nothing though.
Some b/s here but I went into the s3config.rb
Found this line :
confpath = ["#{ENV['S3CONF']}", "#{ENV['HOME']}/.s3conf", "/etc/s3conf"]
and ripped it apart to this :
confpath = ["/etc/s3conf"]
Done, problem solved.
Yes. The environment variables are not being found. This troubled me for a while. It is because the locations you are setting in that initial line of confpath code ["#{ENV['S3CONF']}", ... is not actually the location of the variables contained in the .yaml file.
As Trip says, hard setting that value to the dir containing the .yaml file solved this problem for me.
You could actually set the values using 'export' but really, this is much easier!

Resources