Author Topic: Connection Failed  (Read 569 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Connection Failed
« on: March 05, 2019, 03:39:27 PM »
Hello,

Unfortunately, English is not my native language and I am having a very hard time understanding this line:

Don't forget to add pub key from file /root/.ssh/backup/id_rsa.pub on the remote server to the file "~/.ssh/authorized_keys"

Do I have to add the Public Key located on the Remote BACKUP SERVER (Destination) to the file authorized_keys located on same backup server (Destination)?
Do I have to add the Public Key located on the CWP Server (source) to the file athorized_keys located on the remote backup server (Destination)?
Do I have to add the Public Key located on the CWP Server (source) to the file authorized_keys located on the SWP server (source)?
Do I have to add the Public Key located on the Remote Backup Server (Destination) to the file authorized_keys located on the CWP Server (Source)?

I have tried to make a lot of combinations but unfortunately I am unable to get successful.

I 'd appreciate your help.

Thanks

Offline
***
Re: Connection Failed
« Reply #1 on: March 05, 2019, 09:04:21 PM »
Start with waht you are trying to do.
Are you trying to get passwordless connection..??

Putting the private key in '/root/.ssh/id_rsa.pub' generated at CLIENT computer, and the public in '/root/.ssh/authorized_keys' would be sufficient to 'root' user use passwordless connections.
Note: it is not placed in a 'backup' subdir.
What is your correct user..?? Is root..??

If so, don't forget to set the permissions:
Code: [Select]
# chmod 700 /root/.ssh/id_rsa.pub
# chmod 640 /root/.ssh/authorized_keys

Regards,
Netino

Offline
*
Re: Connection Failed
« Reply #2 on: March 08, 2019, 04:02:57 AM »
Thanks a lot for your reply.
Basically I am setting up remote backup server and for that I think password less connection is required. I have two computers one is CWP computer where all my websites are hosted and second one is the remote dedicated server where I want the daily backups to go for all the users. Now, the issue is that each of these two computers have the private and public keys.

I have generated the keys using ssh-keygen on both computers. But I do not know which pubkey to copy where and on what computer.

Your instructions, I ll check it today and I ll tell you.

Thanks a lot :-)
« Last Edit: March 08, 2019, 04:07:38 AM by nauman »

Offline
*
Re: Connection Failed
« Reply #3 on: March 08, 2019, 07:50:24 AM »
I have tried to add permission as you have told me. But still I am getting Connection_Failed when I try to Test Connection with the remote server. CWP provides me following info after the failed test connection:

Connection_Failed
Don't forget to add pub key from file /root/.ssh/backup/id_rsa.pub on the remote server to the file "~/.ssh/authorized_keys"
Instructions for adding pub key on the remote backup server.
cd ~USERNAME
mkdir .ssh
chmod 700 .ssh
nano .ssh/authorized_keys
*** Now add all content from the file /root/.ssh/backup/id_rsa.pub to .ssh/authorized_keys chmod 600 .ssh/authorized_keys
chown -R USERNAME:USERNAME .ssh
chown USERNAME:USERNAME .ssh/authorized_keys

To test the connection from the command line use the following command: ssh -i /root/.ssh/backup/id_rsa bkup@XXX.XXX.XXX.XXX -p XXX

Here i feel this line very confusing:
Don't forget to add pub key from file /root/.ssh/backup/id_rsa.pub on the remote server to the file "~/.ssh/authorized_keys"


What I am doing is, I generate the SSH Keys on the remote backup server using ssh-keygen command.
On my CWP server I use same ssh-keygen to generate keys. I also press Generate Key button right under the "Remote Backup Settings" table and I am pasting that key on remote backup server's authorized_keys file.

I have done other configurations too as i mentioned in my first post but nothing is working well for me.

« Last Edit: March 08, 2019, 08:36:14 AM by nauman »

Offline
***
Re: Connection Failed
« Reply #4 on: March 09, 2019, 02:40:42 AM »
I would just to copy this page, ipsis literis, but I must respect copyrights:

https://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id

Basicly you must generate the key locally, and after you copy to the server.
Try that, and report us.

Offline
*
Re: Connection Failed
« Reply #5 on: March 10, 2019, 02:19:12 PM »
Thanks a lot for the help.
The article is really very useful and I am able to establish the connection between CWP server and a Dedicated Backup server.

Thank you.

I have setup the remote backup now. I will update this thread as soon as I ll get the backup on Remote Backup server.

Thanks.

Offline
*
Re: Connection Failed
« Reply #6 on: March 10, 2019, 03:18:34 PM »
Hello,
I have run the following command:

/usr/local/cwp/php71/bin/php -d max_execution_time=100000  /usr/local/cwpsrv/htdocs/resources/admin/include/cron_backup.php

It has placed the backups of all users in the backup folder of local computer. Not on remote backup server. Should I have to wailt for getting the backuped files transfered to the dedicated backup server?

Thanks,

Offline
***
Re: Connection Failed
« Reply #7 on: March 10, 2019, 10:38:26 PM »
In CWP, "CWP Settings", "Backup Configuration", you already have configured it there the data of your remote server.?

Offline
*
Re: Connection Failed
« Reply #8 on: March 11, 2019, 07:43:36 AM »
Thanks

Yes, backup configuration was saved. Tonight almost at 11:50pm the backup was shifted to the remote backup server. Daily and Weekly folders are created for each user and SQL backup is also saved. I am very happy and Everything is working fine.


One last thing, I would like to know that this backup contains all the user files and content from the main server?


Thanks again.


Offline
*
Re: Connection Failed
« Reply #9 on: March 13, 2019, 05:12:31 AM »
Hello,

I am receiving a following warning during backup:

###############################################
Remote Daily Files Backup starting
###############################################
Username: xxxxxxx
========================================
Warning: Identity file /root/.ssh/backup/id_rsa not accessible: No such file or directory.
sending incremental file list
xxxxxxxx.com/public_html/
xxxxxxxx.com/public_html/wp-content/plugins/

sent 444,158 bytes  received 7,862 bytes  180,808.00 bytes/sec
total size is 4,569,502,466  speedup is 10,109.07


Should I have to click "Generate New Key" Button under the "Remote Backup Settings" or manually copy the /root/.ssh/id_rsa to the /root/.ssh/backup/id_rsa

Thanks,

Offline
***
Re: Connection Failed
« Reply #10 on: March 16, 2019, 10:08:47 PM »
One last thing, I would like to know that this backup contains all the user files and content from the main server?

No, just for virtual hosts.
If you need backup for the main server, you will need to hardcode it.

Offline
***
Re: Connection Failed
« Reply #11 on: March 16, 2019, 10:12:00 PM »
Should I have to click "Generate New Key" Button under the "Remote Backup Settings" or manually copy the /root/.ssh/id_rsa to the /root/.ssh/backup/id_rsa

The SSHD server, in the default configuration, will read the key only in the '/root/.ssh/' directory.

Offline
*
Re: Connection Failed
« Reply #12 on: March 17, 2019, 06:38:07 AM »
Thanks a lot for your help...