ch15 elastic hosts-svradmin

23
Linux Server Admin Elastichost Server Admin I Chatchai J 2013-01-28

Upload: chatchai-jantaraprim

Post on 19-Jun-2015

142 views

Category:

Documents


6 download

TRANSCRIPT

  • 1. Linux Server AdminElastichost Server Admin IChatchai J2013-01-28

2. First login vncviewer$vncviewer$ELASTICHOSTSIP password:******* login:root no password secureshell$sshtoor@$ELASTICHOSTSIP password:******** 3. initial setup set root password#passwdroot disabled toor account#passwdltoor create admin account#useraddmGsudos/bin/bashcAdmincj#passwdcj#aptgetinstallsudo 4. initial setup (cont) setup hostname on local VM$sudoshcecho216.157.xx.xxremote>>/etc/hosts$sudoshcecho216.157.83.88cheshire>>/etc/hosts user remote login$sshuser@remote$sshcj@cheshire at remote vm$sudoaptgetyupdate setup 5. Setup secure shell key remote server GUI (vncviewer) local Linux VM local:~$ remote Elastichost VM remote:~$local:~$remote:~$ 6. Setup secure shell key (cont) secure shell key remote login pass-phrase passwordlocal:~$sshkeygenEnterfileinwhichtosavethekey(/home/cj/.ssh/id_rsa):Enterpassphrase(emptyfornopassphrase):Entersamepassphraseagain: ENTER passphrase id_rsa id_rsa.pub sub directory .ssh 7. Setup secure shell key (cont) key remote hostlocal:~$sshcopyiduser@remoteuser@remotespassword: message ~/.ssh/authorized_keys remote host ~/.ssh/id_rsa.pub local:[email protected]/authorized_keyslocal:~$cat.ssh/id_rsa.pub 8. Setup secure shell key (cont) : login remotehost execute password secure shell privatekey ~/.ssh/id_rsa 9. Setup secure shell key (cont) id_rsa remote host password sudo NOPASSWD: : passphrase key local:~$sshkeygenp 10. Setup secure shell key (cont) : passphrase WRONG gnome windows manager text mode setup key password passphrase secure shell key ? 11. Setup secure shell key (cont) GUI logout login Gnome gnome-keyring-daemon seahorse EncryptionKey Manager key Menu System ->Preferences->Passwords and Encryption Keys Tab Personal Keys Export, Copy, Delete, Change Comment/Password 12. keychain terminal console remote login run gnome Notebook Admin PC Server GUI (gnome) text terminal text terminal keychain Seahorse 13. keychain (cont) keychainlocal:~$sudoaptgetinstallkeychainsshaskpass .bashrc if[x/usr/bin/keychain];then keychainid_rsa [z"$HOSTNAME"]&&HOSTNAME=`unamen` [f$HOME/.keychain/$HOSTNAMEsh]&& .$HOME/.keychain/$HOSTNAMEsh fi 14. Setup secure shell key (cont) keychain seahorse passphrase secure shell key secure shell key key run host 15. sync config using rsync / backup config sync config remote local rsync rsync local remotelocal:~$sudoaptgetinstallrsynclocal:~$sshtremotesudoaptgetinstallrsync 16. sync config (cont) First Synclocal:~$sudosulocal:~#cd;mkdirREMOTE;cdREMOTElocal:~/REMOTE#rsyncavuProot@remote:/etc/etclsa:~$sudosulsa:~#cd;mkdircheshire;cdcheshirelsa:~/cheshire#rsyncavuProot@cheshire:/etc/etc 17. sync config (cont) sync local:~/REMOTE#rsyncavuPetcroot@remote:/lsa:~/cheshire#rsyncavuPetcroot@cheshire:/ 18. sync config (for bind)local:~/REMOTE#rsyncavuProot@remote:/var/cache/bindbindlocal:~/REMOTE#rsyncavuPbindroot@remote:/var/cache/ 19. sync config (deleted files) rsync --delete --delete-after manual page rsync option 20. sync config Note: config local copy sync config remote server sync YOU HAVE BEEN WARNED /update package config server server server ( ) 21. Elastic VM Setup /etc/hostname cheshire.cheshirecat2012.net (cheshire) / (www, ns, smtp, ) server server /etc/apt/sources.list default point to ftp.uk.debian.org elastichosts US => ftp.us.debian.org 22. VM Setup (cont) pacakge serverlocal:~$sshtremotesudoaptgetinstalltmux