Solved VPS v. Cloud hosting

No, by default sshd(8) will accept both passwords and ssh keys. No need to configure anything.

Did your VPS have a ready-made FreeBSD image? Or did you do the install remotely yourself? If it's a pre-made VPS image from that provider it may have been configured with a default username/password combination. Something you regularly seem to skip entirely, read their documentation.
I downloaded the 15.1-RELEASE boot iso and installed from that myself.
 
balanga On my VPS, you can access your server directly through their web site using your account.
Is it possible to get to a command prompt?


After cliicking around various screens I seem to have obtained access.

It says

Connected to QEMU (instance-00002235)
Send CtrlAltDel


on the top line.

So it looks like I should be able to find out why I can't SSH in.
 
I downloaded the 15.1-RELEASE boot iso and installed from that myself.
Ok, cool. So you did the entire installation yourself? Including setting a password on the root account? Did you also add a regular user account? If not, you know you cannot login with root remotely, that's disabled. So you'll need to login on the console, that same console you used to install FreeBSD on that VPS.

Next time you do a FreeBSD install add a regular user and add that user to the wheel group. Then you can use that user account to login remotely, and because it's in the wheel group allow you to su(8) to root.
 
So it looks like I should be able to find out why I can't SSH in.
root logins are disabled by default. Do NOT enable this. It's been up for a couple of minutes and I'm pretty sure the malware bots have already been knocking on your door.

Just add a regular user account and add that user to the wheel group. Or install security/doas/security/sudo (whatever is your preference). Configure it.
 
Ok, cool. So you did the entire installation yourself? Including setting a password on the root account? Did you also add a regular user account? If not, you know you cannot login with root remotely, that's disabled. So you'll need to login on the console, that same console you used to install FreeBSD on that VPS.

Next time you do a FreeBSD install add a regular user and add that user to the wheel group. Then you can use that user account to login remotely, and because it's in the wheel group allow you to su(8) to root.
Yes I added a regular user. As a publicly accessible site I didn't want to allow root access to ssh.
 
After trying to ssh into my VPS I get:-

Permission denied (publickey,keyboard-interactive).

Looks like I haven't configured it correctly. I think I just used the defaults.

Looks like I had a brain fart. Maybe wrong user or wrong password initially but it working just as it should when I enter everything correctly/
 
If you're concern about AWS surprise bills you can try AWS Lightsail.
It's the AWS fix price/month virtual server service.
You can have a 7$/month server, it depends on your needs and recommended for small projects.
When you register you get 100$ credit to try services and lightsail is included, so you can have a server for free for 1 year.
I'm not sure about having a FreeBSD running there.
EDITED:
FreeBSD is available too in the drop down but this will give you a UFS storage.
If you need ZFS then you have to setup a EC2 mentioned already in the thread.
 
I have a VPS now

Cloud VPS plans starting at $4/mo​


from https://ramnode.com/

The nice thing is that you download an image from some URL and proceed to install it as if was on your local machine so ZFS is an available option.

FreeBSD doesn't need to be available from a drop down list

With AWS I spent two days trying to open an account, and now I'm glad I didn't.
 
SSH keys aren't, IMHO, that complicated. (Of course, most things are easy when you know how to do them). Anyway, here's a DigitalOcean guide that seems pretty straight forward.

Looks pretty long and complicated with plenty of scope for making errors, so I'll try to come up with a script to implement it.

The initial problem is which scheme to use.

What do people suggest?
 
What do people suggest?
In remote a file ~/.ssh/authorized_keys containing the private key.
In local a file ~/.ssh/id_rsa containing the private key, chmod 300.

Generate the key pair id_rsa (private) and id_rsa.pub (public) with ssh-keygen.
In the process give the private key a password.

The only problem is to put id_rsa.pub in the remote host. Do it with scp using the password,
probably for last time. So

scp id_rsa.pub remoteuser@remotehost:

Then (login with pass) and rename it to ~/.ssh/authorized_keys.

I do not understand what is the problem.
 
I have a VPS now

Cloud VPS plans starting at $4/mo​


from https://ramnode.com/

The nice thing is that you download an image from some URL and proceed to install it as if was on your local machine so ZFS is an available option.

FreeBSD doesn't need to be available from a drop down list

With AWS I spent two days trying to open an account, and now I'm glad I didn't.
$4 for 512MB RAM, 1 Core, 20GB SSD and 1TB bandwidth, what happens when you consume all traffic here?
well, it depends on what you want to run there and how much traffic your software needs.
Don't forget to setup a firewall or you may get some smart guy attacking the system and consuming your traffic to the limit.
 
$4 for 512MB RAM, 1 Core, 20GB SSD and 1TB bandwidth, what happens when you consume all traffic here?
well, it depends on what you want to run there and how much traffic your software needs.
Don't forget to setup a firewall or you may get some smart guy attacking the system and consuming your traffic to the limit.
It's early days yet. I'm slowly finding my around and have no idea how much traffic there will be. It's just a hobby project at the moment which may or may not prove worthwhile but it's good push your frontiers.

AFAIK it's straightforward to add more of everything as and when needed.

I will be adding a firewall shortly.
 
SSH keys aren't, IMHO, that complicated. (Of course, most things are easy when you know how to do them). Anyway, here's a DigitalOcean guide that seems pretty straight forward.


The stuff at the beginning might prove useful to you for better understanding it, but I think you might be able to skip right to the section Generating and Working With SSH Keys. There's a table of contents on the left and you can just go to that part. I just skimmed the article, so, in case it doesn't mention it, in my opinion set up the key for a username and have that user be able to su to root (or use sudo, doas or mdo--assuming you're using FreeBSD, if using Linux sudo is probably easiest) rather than setting up an ssh key for root.
What difference does it make which keys (rsa, ecsda etc) you use?

What do most people use?
 
In remote a file ~/.ssh/authorized_keys containing the private key.
In local a file ~/.ssh/id_rsa containing the private key, chmod 300.

Generate the key pair id_rsa (private) and id_rsa.pub (public) with ssh-keygen.
In the process give the private key a password.

The only problem is to put id_rsa.pub in the remote host. Do it with scp using the password,
probably for last time. So

scp id_rsa.pub remoteuser@remotehost:

Then (login with pass) and rename it to ~/.ssh/authorized_keys.

I do not understand what is the problem.
I made some progress with ssh-keygen and managed to use ssh-copy-id to copy my keys to my local server, but it didn't work trying to copy to my VPS host.

I got permission denied when trying to do so,

Code:
/bin/sh: cannot create /home/user/.ssh/authorized_keys: Permission denied

Maybe I entered the password wrongly.
 
I made some progress with ssh-keygen and managed to use ssh-copy-id to copy my keys to my local server, but it didn't work trying to copy to my VPS host.
Try as I said. Do not make your life difficult with tools conceived to do life easy.

The thing easy, and the solution should be easy.

The two keys you generated with ssh-keygen are so, that one decrypts what the other encrypts. If an entity has one
and other entity the other, they can exchange challenges. You must give each of the entities one key.

One should be in the home directory of the remote user, id_rsa.pub as ~/.ssh/authorized_keys,
the other, the id_rsa, in the home directory of the local user as ~/.ssh/id_rsa
(you can leave also id_rsa.pub there).

Owner of the files should be the remote user in the remote computer, the local user in the local computer.
Permissions of ~/.ssh/authorized_keys and ~/.ssh/id_rsa should be -rw-------,
permissions of ~/.ssh/id_rsa.pub should be -rw-r--r--

Put everything in its place as the right owner with the right permissions, as you can, with normal unix commands,
with scp, rsync, ftp, copy and paste, whatever you can.
 
Back
Top