Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts

Monday, August 8, 2011

ssh tanpa password dari server A ke B

Lakukan ini di server A di home nya
Bila login dg user root, maka lakukan di server A di folder: /root#

ssh-keygen -t rsa

(tekan enter 3 kali saja sampai keluar)


ssh username@serverB mkdir -p .ssh 

(masukin password di server B) 
 bila ada error 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

maka perlu dihapus dulu di serverA:
ssh-keygen -R serverB
ULANGI DARI ATAS LAGI

cat .ssh/id_rsa.pub | ssh username@serverB 'cat >> .ssh/authorized_keys'

(masukin password di server B)


Selesai :)

Wednesday, July 20, 2011

Backup Restore Linux

The best tool to use for this is probably dump, which is a standard linux tool and will give you the whole filesystem. I would do something like this:

/sbin/dump -0uan -f - / 
| gzip -2 
| ssh user@serverB 
dd of=/backup/server-full-backup-`date '+%d-%B-%Y'`.dump.gz

This will do a file system dump of / (make sure you don't need to dump
any other mounts!), compress it with gzip and ssh it to a remote server
(serverB), storing it in /backup/. If you later need
to browse the backup you use restore:
 
restore -i
Another option, if you don't have access to dump is to use tar and do something like

tar -zcvpf /backup/full-backup-`date '+%d-%B-%Y'`.tar.gz 
--directory / --exclude=mnt --exclude=proc --exclude=tmp .

But tar does not handle changes in the file system as well.