This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Cloning ubuntu 14 setup
#1
Cloning ubuntu 14 setup
I'll ask here first...
I have setup my sentora on ubuntu 14 on a old 160gb sata drive i had lying about.
Now what i would like to do is transfer it all to a 500gb SSD (CLONE)
I was wondering if anyone has done this successfully and what is the best & safest way to do this ?
Thanks
Reply
Thanks given by:
#2
RE: Cloning ubuntu 14 setup
You can do that easily.

Setup the new clean ubuntu on 500GB SSD.

Then install the same version as the old sentora.

Move /var/lib/sentora from the old.

Move MySQL root folder too with all the databases.

Move /etc/sentora/ with all your configs.

If you have emails tool. That would work.

I've done that more than once and it's fine.

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask

200$ free to start your VPS 60 days credit
Reply
Thanks given by:
#3
RE: Cloning ubuntu 14 setup
/var/lib/sentora/ ? I do not have that on Ubuntu. Do you mean /var/sentora/ ?
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:
#4
RE: Cloning ubuntu 14 setup
Quote:You can do that easily.

Setup the new clean ubuntu on 500GB SSD.

Then install the same version as the old sentora.

Move /var/lib/sentora from the old.

Move MySQL root folder too with all the databases.

Move /etc/sentora/ with all your configs.

If you have emails tool. That would work.

I've done that more than once and it's fine.

M B
I still cannot get Root access via winscp?
I tried copy over them folders but got read permissions error on a few folders/files
what way can i do this via ssh terminal ? what are the commands pls ?
also where is mysql root folder ?
Reply
Thanks given by:
#5
RE: Cloning ubuntu 14 setup
(01-27-2018, 01:41 PM)CMs222 Wrote: I still cannot get Root access via winscp?
I tried copy over them folders but got read permissions error on a few folders/files
what way can i do this via ssh terminal ? what are the commands pls ?
also where is mysql root folder ?

I know many members have explained to you on how to setup SSH with WinSCP or other sftp clients the way to have root privileges and the need if you are going to do this to use encrypted keys to log in rather than a username and password. I am not sure why this is so difficult for you to do...

As far as cloning your setup to a new drive, not to poo poo what Me. B noted (glad he posted it...) - but why don't you just use an offline backup and recovery solution to transfer your entire drive to the new SSD? Many SSD's come with the software to do it and if it does not, use Google or your favorite browser to find an application to clone your current ENTIRE drive.

I would guess you are going to have "some" downtime however you do this, but just seeing your posts I know you have made a bunch of changes to your 1.03 install and this makes me think it may be a bad thing to install SENTORA from the installer on the new SSD and then attempt to get all of your changes, bug fixes, etc. transferred to it too.
Everyone makes mistakes, but to truly screw up it takes the root password!
Reply
Thanks given by:
#6
RE: Cloning ubuntu 14 setup
Ignore this post... Blush
Everyone makes mistakes, but to truly screw up it takes the root password!
Reply
Thanks given by:
#7
RE: Cloning ubuntu 14 setup
(01-29-2018, 09:47 AM)worksmarter Wrote: I know many members have explained to you on how to setup SSH with WinSCP or other sftp clients the way to have root privileges and the need if you are going to do this to use encrypted keys to log in rather than a username and password. I am not sure why this is so difficult for you to do...

I followed this thread reply http://forums.sentora.org/showthread.php?tid=4307 which is the only reply
(not Many Members have explained)
I don't know how to use encrypted keys. I'm trying to learn this stuff... I am a beginner forced into early retirement due to a work accident, so to keep myself occupied i have turned to sentora.. not looking to be the next bill gates. just wanna run a web server from home to host a few freiends websites +

I can imagine you get fed up with the same questions being asked over & over again Sad
Believe me i do search the forum first and try to wade through the mine field of posts and threads.
and also search on google which can be even more painful Smile
and have then been accuse of hijacking other members threads. which is not my intention.
Reply
Thanks given by:
#8
RE: Cloning ubuntu 14 setup
(01-29-2018, 01:50 PM)CMs222 Wrote: I followed this thread reply http://forums.sentora.org/showthread.php?tid=4307 which is the only reply
(not Many Members have explained)
I don't know how to use encrypted keys. I'm trying to learn this stuff... I am a beginner forced into early retirement due to a work accident, so to keep myself occupied i have turned to sentora.. not looking to be the next bill gates. just wanna run a web server from home to host a few freiends websites +

I can imagine you get fed up with the same questions being asked over & over again Sad
Believe me i do search the forum first and try to wade through the mine field of posts and threads.
and also search on google which can be even more painful Smile
and have then been accuse of hijacking other members threads. which is not my intention.

Look into using public and private keys to authenticate your log in to your server. This is the google search for Using private and public keys to log into a server using ssh
.
https://www.google.com/search?q=using+pu...e&ie=UTF-8

What this allows is two fold, mainly you can log into your server as root and have the key and all communications between your PC and the server be encrypted - (stopping a man in the middle attack that can snatch your login credentials when you log in in plain text as you are with a username and password.) This also allow you to turn off in your SSH configuration file standard username/password log in.

Once you have set up SSH to use keys, you can have pagent or kagent run on your PC and have WinSCP Putty Kitty or whatever program you are using to communicate with your server work in an automated fashion - read up on what pagent or kagent is for... Pagent will run your certificate in the background and allow you to log in via SSH without you personally having to enter anything. I would also recommend you use something like mRemoteNG for your SSH command line interface. It plays nicely with pagent and will allow you to log in to your server with only storing your user name (root or a lower username) and having pagent inject the proper key to log in with. - Makes working in bash a one click matter.

As is mentioned by TGates, you should only allow root login for temporary administration and then turn it off. You can also make a pair of keys for a lower privileged user to then sudo to root - this works for most cases and is the right way to do things. This allows you to turn off "Login as Root" in your SSH config file. The only thing you might need to have the root user log in to your server is if you are manipulating files in WinSCP that need root permissions. Working on the command line, 9 times out of 10, logging in as a lesser user and sudo'ing to root will work and is the safe and right way to work on your server. Again I use in Windows mRemotNG as a command line connection to run instructions on the server.

Google around. Follow some tutorials, it is not that hard if you can just follow instructions.

As for cloning your setup to an SSD - I still maintain you should just clone the entire drive you are already using to the new SSD. With all of the modifications you have made, if any of them are not contained in the folders mentioned by Me. B, you might wreck your install or have to track down issues you have already solved.
Everyone makes mistakes, but to truly screw up it takes the root password!
Reply
Thanks given by: TGates , CMs222
#9
RE: Cloning ubuntu 14 setup
using this guide > https://devops.profitbricks.com/tutorial...n-windows/
Create New Public and Private Keys:
number 4. when saving private key, it prompted me to add a passphrase (should I ?) as its not mentioned in guide...
Copy Public Key to Server:
got to number 3. and when i went to safe got error
[ Error writing /home/*******/.ssh/authorized_keys: No such file or directory ]

So i'm stumped again Sad
Reply
Thanks given by:
#10
RE: Cloning ubuntu 14 setup
(01-31-2018, 05:48 AM)CMs222 Wrote: using this guide > https://devops.profitbricks.com/tutorial...n-windows/
Create New Public and Private Keys:
number 4. when saving private key, it prompted me to add a passphrase (should I ?) as its not mentioned in guide...
Copy Public Key to Server:
got to number 3. and when i went to safe got error
[  Error writing /home/*******/.ssh/authorized_keys: No such file or directory ]

So i'm stumped again Sad

Hypothetically, you should use a passphrase (password) for the certificate. The upside of not using one is that you don't have to type in a password for the key to work each time. I cannot recommend you NOT using a passphrase for your certificates, but can tell you I have done it both ways and find my laziness prevails and I don't use a passphrase. This is a compromise in security, but nowhere nearly as bad as using a username and password in plain text is. The web can tell you more about the absence of a passphrase and its vulnerabilities. Google that...

What happens in step three? Did you use vi to create (and edit) the authorized_keys file? Do you have vi installed on your Ubuntu install? It comes with CentOS. You should when you type:

Code:
vi ~/.ssh/authorized_keys

be creating and editing in the root folder because of the ~. What are you typing into bash for step 3? Your error tells me you are trying to make keys/certificates for a user other than root. The article's command will only work for root. You must have changed the vi command to your other user in the home folder.

Code:
Error writing /home/YOURUSERNAME/.ssh/authorized_keys: No such file or directory

Your error is because of the "~" in the command - it puts you into the /root folder which does not have a /home folder in it. The home folder is at the top level ("/")... You would need:

Code:
vi ~/../home/YOURUSERNAME/.ssh/authorized_keys

to work in the home folder.

Did you try?

Code:
sudo vi ~/../home/YOURUSERNAME/.ssh/authorized_keys

As per your past postings - wanting to be able to use WinSCP to modify and manipulate folders that have root privileges, you will need to make the key for the root user, otherwise you will run into the same issue as you have in the past with manipulating files in WinSCP.

Please outline what exactly you are doing and have done as it is not the same as that tutorial. I also save my keys to a folder called keys on my PC's C: drive at the top level. Then I use Pagent or Kagent that starts and loads the keys when I start windows to maintain the keys for when I use WinSCP, Filezilla, or mRemoteNG as a bash terminal so they simply log into the server on their own. No passphrase for the keys allows me to log in to my server with one click from these applications.

Can you post your work up to where you have problems? If you are using another user, put something like "otherusername" instead of ******. We need to know if you are:

A) Working as root user
B) Trying to create keys for *what* user - remember, to mitigate your issues with file permissions in WinSCP will take making keys for root.
Everyone makes mistakes, but to truly screw up it takes the root password!
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
OS - Ubuntu 18.04 or Centos 8 Qrash 1 5 ,319 01-18-2021, 07:48 PM
Last Post: Jettaman
Ubuntu 18.04 vaxition 1 4 ,788 08-06-2020, 11:03 AM
Last Post: Jettaman
Php5.6 on ubuntu possible? lorenaustin 0 2 ,568 06-11-2020, 01:01 AM
Last Post: lorenaustin

Forum Jump:


Users browsing this thread: 6 Guest(s)