Accessing files from dreamcompute vps

dreamcompute

#1

I’m very new in this subject, but the problem is: I can’t access files from a website to make small html edits. The only thing I know is that I need to make it using SSH.

What I’ve tried:

  • I generated a private and a public key of type SSH-1 (RSA) using PuTTYgen,
  • At dreamcompute Access & Security panel, I imported the public key generated,
  • At PuTTY, I placed my site IP at Host Name field. In Connection->Data, I placed the username. In SSH section, I chose 1 as preferred SSH protocol version. And at SSH->Auth I set the private key path.
  • Finally, I opened the connection.

I’m getting this error message:

Unable to use key file

What am I missing? Is that the right way to access the files?


#2

Hello matalv!

You’ve gotten quite far, wooo! You are going about it the proper way but maybe some details got mixed up in the process!

So you’ve generated a keypair and successfully imported the public key to the openstack panel. When you launched your instance, did you make sure to specify that it launch with that keypair?

Also you should not have to choose “SSH-1” in PuTTY, I don’t recommend changing the default settings (except perhaps agent forwarding if you need it)

Everything else looks like it’s squared away, remember the default user is dhc-user :slight_smile: Let me know if that solves your problem, there are also handier ways to import public keys with a “cloud-config” file which you can find on the openstack website.


#3

It sounds like you’ve selected SSH version 1 in PuTTY. Don’t do that. This protocol is obsolete and insecure, and is disabled by default on DreamCompute instances.

Leave the settings at the default of SSH 2.


#4

Hi! Thanks for the reply! Here what I tried:

At dreamcompute panel, I created a private key and downloaded it, a .pem file. Using PuTTYgen, I converted this file to .ppk as SSH2-RSA (not 1 anymore). So, I downloaded Pageant.exe and added this .ppk file. At PuTTY.exe, I put as Host Name the floating IP gotten from dreamcompute panel, set the username at Connection->Data as dhc-user and, finally, loaded the .ppk file at Connection->SSH->Auth. Now, the problem is when I open the connection, the authentication process keeps asking me for password. What am I missing? Shouldn’t It be only username and keys?

At overview page, there is an instance table with one line. At Key Pair column, the value is a Key Pair that I’m not using to login. Would be that the problem? I don’t know whats an instance :frowning: . If that’s the problem, how can I change the keypair of this instance? I didn’t find an option for it…


#5

Heyo!

Sooooo close!

I haven’t used the dreamcompute’s keygeneration options (Though I’m 100% they work).

Let me tell you what I do.

First, get PuTTYgen. This is a key generator! Select the key size/type you want to use (I use SHA2-4096bit keys, but 2048 is the “standard” for these things). Click generate and move your mouse over the open space at the top of the window.

Now open up the dreamcompute panel and select “Access and security” then the “Keypairs tab”, then click the “Import Key Pair”, a window will pop up. Put any name you like (it’s not important). Go back to the PuttyGen window, and highlight the key in it’s entirety (make sure you get all of it) and paste it to the box labeled “public key”. After click “Import Key pair” and wait for a success message. If you get a fail message you might have missed a line of the public key.

Now go back to the puttygen window. This is the most important step because if you do everything else right and mess this part up you will not be able to get back into your server.

Click the Save private key button. This is your secret key. I do not generally password protect my key, this means that anybody who can copy my keyfile from my desktop can use my key. You MUST encrypt your private key. You MUST PROTECT the key you just saved. An option for you could be Veracrypt ( I don’t use windows so I can’t vouch for it, but it is the popular option).

Ok so now dreamhost knows the public key we’re going to use to launch our servers, we’ve got our key protected when we’re not using it by encryption and that’s awesome, now to getting the server running.

So I run some archaic distros usually so I will refer to your operating system as just *nix, at this stage there isn’t much difference between the “flavors” if you will.

In the dreamcompute panel select “Images”, then click on the “Public Images”. Select your *nix and select “Launch”. Choose the size of your instance and in the “Access and security” panel select the name of the key we imported earlier. Then choose your network and click launch.

Once your instance is running and you’ve attached a floating ip to it then open up PuTTy the client. I see you’re using pageant and that’s fine but let’s make sure it works with PuTTy first. Input your address, go to authentication and add the key that I stressed should only be decrypted while in use. Then click connect and use dhc-user as the login name. Let me know if this works for you. (Note: After you’re authenticated with the server you may re-encrypt the key, it only needs to be decrypted while you’re authenticating.)

I hope this works, I don’t think I’ve missed out on anything, cheers!

Edit: Just saw your edit. That is indeed the problem. An instance is what you’re trying to log into, no it cannot be changed once it’s launched you’ll have to relaunch, I recommend using my instructions because I think you’ve actually ruined your keyfile with the conversion you attempted.


#6

Hi!! Thanks for everything till here!

Actually, the private key relative to this instance is lost. I got this problem by the half way… I think I’m gonna need do this relaunch… Is there any problem about doing this?


#7

I don’t quite understand what you’re concerned about! :slight_smile:

The instance you have now is unusable because you cannot log-in! This is expected behavior given the situation (botched keygen process) that you’re in. I recommend starting again from square one! If you follow my directions to create a new instance (a new server) I’m pretty sure you will be able to log in. I’ve tested it on debian.

Delete the old public key so you don’t confuse them in the future. You do not have to generate new keys every time, they are reusable as long as you only ever share your public key.


#8

Nice! I understood everything and I’ll follow everything as you said! Thank you for all the help :smiley:


#9

Anytime! Another quick piece of advise though.

Once you login you’re going to be at the cleanest state possible for your server. Consider taking a snapshot of your instance once you’ve logged in as root if you don’t want to repeat the process over and over. You can do that from the dreamcompute panel. And since you’re doing research on how to do some simple things I would suggest checking out https://www.kernel.org/doc/man-pages/ That is the documentation for linux, there are variations amongst distros but that is the nitty gritty documentation for the kernel. It supersedes all blogs, all forums, and IRC chats in terms of useful content. Another great book to seek out would be “The Linux Programming Interface”, it is a source of documentation that will help your understanding of what’s happening under the hood. Don’t worry if you’re not a programmer of anykind, you don’t have to understand the scripts to make use of that book, trust me, the understanding portion comes with experience and either tears or restless nights. Your chosen distro also definitely has it’s own curated man-pages under some sort of documentation tab, not usually under the FAQ.

If this is your first time I would read the socket(also called a port) documentation found in the book I mentioned and understand that you’re utilizing one of those to log in to your instance. The software/utility portion of the login is called a geTTY.

As far as usability goes, the first thing you need to do is make user accounts try to find how to do it from the man pages I linked or the ones for the distro you’re using. Find out why you wouldn’t want to run software as the root user, and learn about user-groups. If you can do that, you can literally do anything else, you don’t need to understand every little piece but you have to know where to find the documentation when you’re going to do something specific.

Cheers!

Edit: https://cloudinit.readthedocs.org/en/latest/topics/examples.html That is a way to launch your instances with a lot less clicking, you can simply copy and paste every time you need to restart from scratch. If you want to know more about the dreamcompute panel and the technology used to network and launch your instances you can check out the Openstack Project.