Error trying to make a new Mail in a box installation

Using my terminal on my laptop i enter inside mai server:
ssh root @ MY IP
when I was inside my server I have tryed to do a fresh new mail in a box installatio writing:
sudo mailinabox
an this below is the error message I receive:

ln: failed to create symbolic link ‘/home/user-data/ssl/ssl_certificate.pem’: File exists

what can I do?
how can i make e new clean installation of mail in a box?

thanks in advance
Gaetano

https://mailinabox.email/guide.html

In the guide there is written:

" Setting Up The Box
You will now have to log into your running box using SSH. Your cloud provider will probably give you some instructions on how to do that. If your personal computer has a command line, you’ll be doing something like this:

ssh -i yourkey.pem ubuntu@10.20.30.40

Legal note! Mail-in-a-Box is made available per the CC0 public domain dedication. By running Mail-in-a-Box, you will invoke scripts that use Let’s Encrypt to provision TLS certificates per the Let’s Encrypt Subscriber Agreement(s) & Terms of Services. Please be sure you accept the terms in both documents before proceeding.

Once inside, you will now get the Mail-in-a-Box code onto your box and start its setup. Copy and paste this into your terminal and hit enter:

curl -s https://mailinabox.email/setup.sh | sudo -E bash"

where I find “yourkey.pem”?

Thanks
Gaetano

T

Wherever you have saved your keypair on your laptop … if you even have one.

ok so instead of “yourkey.pem” i have to put the public key? or I have to edit the file with nano and insert may public.key?

What is your laptop’s OS?

my laptop is windows but i run on it ubuntu on virtual machine to connect to my server on wich I have installed mailinabox

Perfect … so you should have created a keypair using ssh-keygen

Once you have created the key and uploaded it to the server then you log in with the command ssh user@ip. You do not need the ‘-i yourkey.pem’ if you save it in the default location. Read the linked guide for more information.

You say:
" Once you have created the key and uploaded it to the server then you log in with the command ssh user@ip . You do not need the ‘-i yourkey.pem’ if you save it in the default location. Read the linked guide for more information."

This is the problem !!
The server does not recognize no more the public key.
I thin I have cancelled for error from the server.
I am notn able to put inside again with ssh-copy-id command

Then you are going to have to access your server via the Digital Ocean console and fix the ~/.ssh/authorized_keys file.

or edit /etc/ssh/sshd_config to allow password based authentication temporarily.

I don’t use digital ocean but aruba server cloud.
any way I have solved:
when from the terminal i write
$ sudo mailinabox
i receive the following answer:
“ln: failed to create symbolic link ‘/home/user-data/ssl/ssl_certificate.pem’: File exists”

so I have decided to rename ssl_certificate.pem in ssl_certificate.pem.old

after a send again
$ sudo mailinabox

and the installation finally start and finish!!

Thanks anyway. :slight_smile:
Gaetano