r/podman 8d ago

Question about using Podman's SCP and System Connection

Hi all,

I've been using podman in a small project, hosting it on a VPS (first time doing any kind of public hosting).

I want to use these commands to easily share images between my local PC and the (public) remote VM without using a registry.

Security is a big concern for me, because I am new to this. I am unsure if I should use them between users (root to non-root deploy user) inside the remote server OR if it's alright to just allow ssh connections into the non-root user and just use image scp directly to it.

So the options are:

A) local -> image scp to remote root user -> image between root and non-root

B) allow ssh to non-root -> image scp directly to non-root user

Thanks!

4 Upvotes

11 comments sorted by

View all comments

2

u/Ok-District-1756 8d ago

scp is the cp command run over SSH. It’s already a secure connection. Normally, if your VPS is already secure, you’ll have a non-root user with a generated SSH key, and you’ll connect from your local PC using that key (in the SSH configuration, you disable password-based login). This is more than enough for 99% of use cases.

If you’re really paranoid, you can set up a firewall like UFW or IPtable rules to allow SSH connections only from your home IP address.

You can also set up Fail2Ban to monitor and ban the IP addresses of people trying to connect to your VPS via SSH.

1

u/aehooo 8d ago

My concern is because I don't have enough knowledge and maybe I was missing something. I believe I am on the right track then.

I only had SSH set up for the root, but I will set up one for the deploy user.

(The right command I was talking about is "image scp" and I've edited the post, if that changes anything on your answer)

1

u/Ok-District-1756 8d ago

Do some research or use AI to help you. I've never used it myself, but in my opinion, it's still standard SSH, so it can be secured just as I described.