{"id":35,"date":"2008-09-14T19:46:30","date_gmt":"2008-09-14T07:46:30","guid":{"rendered":"http:\/\/p-s.co.nz\/wordpress\/?p=35"},"modified":"2008-10-09T09:31:18","modified_gmt":"2008-10-08T21:31:18","slug":"windows-xp-died-welcome-ubuntu-hardy-heron","status":"publish","type":"post","link":"http:\/\/p-s.co.nz\/wordpress\/windows-xp-died-welcome-ubuntu-hardy-heron\/","title":{"rendered":"Windows XP Infested, Replace with Ubuntu Hardy Heron"},"content":{"rendered":"<p>The nasty virus infestation was the final straw and my father-in-law wanted to switch to Ubuntu.  He wanted better security and peace of mind.<\/p>\n<p>Step 1 &#8211; Use live CD to check that Ubuntu works OK with hardware (monitor, printers, keyboard, mouse, scanner, soundcard)<\/p>\n<p>Step 2 &#8211; Transfer ALL files (including malware) from windows PC to my Ubuntu notebook using ssh<\/p>\n<p>Type into terminal sshd<br \/>\nFollow the (extremely simple) instructions to install ssh server on notebook so we can send it files<br \/>\nConnect PC and notebook with ethernet cable (NB modern network cards probably make it unnecessary to use a special crossover cable)<br \/>\nSet wired connection on PC to static IP<br \/>\nReboot (not sure if always or even usually necessary but it can remove some problems<br \/>\nSet wired connection on notebook to a different static IP<br \/>\nReboot (probably not necessary but doesn&#8217;t take long)<br \/>\nOn PC ping self in terminal e.g. ping own_IP (Ctrl-C to interrupt)<br \/>\nOn notebook ping self in terminal e.g. ping own_IP (Ctrl-C to interrupt)<br \/>\nPing each machine from the other e.g. on notebook ping PC_IP<br \/>\nIf all pinging works, run the following (NB assumes drive mounted as drive 1):<br \/>\nscp -pr \/media\/disk1 username_on_dest@notebook_IP:~\/savedpc<br \/>\n(scp <a href=\" http:\/\/linux.about.com\/od\/commands\/l\/blcmdl1_scp.htm\"> http:\/\/linux.about.com\/od\/commands\/l\/blcmdl1_scp.htm<\/a>)<br \/>\nAt the end check that the same number of files etc made it across.<br \/>\nThen set the permissions for the oldpc folder (and all its contents) to read only etc<\/p>\n<p>NB wipe ssh server off notebook to reduce attack surface. sudo apt-get remove name_of_ssh_server_package<\/p>\n<p>Step 3 &#8211; Perform guided installation of Ubuntu wiping entire hard drive<\/p>\n<p>Step 4 &#8211; Set up Ubuntu (see <a href=\"http:\/\/p-s.co.nz\/wordpress\/?p=28\">http:\/\/p-s.co.nz\/wordpress\/?p=28<\/a><br \/>\nNB we need internet access so we can temporarily switch from static IP for the wired connection to DHCP.<\/p>\n<p>Step 5 &#8211; Transfer all files back into a folder called oldpc<\/p>\n<p>Type into terminal sshd<br \/>\nFollow the (extremely simple) instructions to install ssh server on PC being rebuilt so we can send it files<br \/>\nRun the following:<br \/>\nscp -pr name_of_folder_to_shift_back username_on_dest@PC_IP:~\/oldpc<br \/>\nAt the end check that the same number of files etc made it across.<br \/>\nThen set the permissions for the oldpc folder (and all its contents) to read only etc<\/p>\n<p>Step 6 &#8211; Enable remote access into PC from notebook<br \/>\nNB initially we are setting this up with the PC in the same room sitting on the same network as the local notebook.  Once everything is set up and we install the PC where it actually belongs we will need to use a different IP address.  Vinagre&#8217;s Find method will no longer work because it works on the local network.<\/p>\n<p>6.1 Set up ADSL modem to allow packets from obscure port through to ssh port (22).  Some modems have it as a NAT rule, some as port forwarding (basic) etc.<br \/>\n6.2 On PC go System>Preferences>Remote Desktop and Allow other users to view your desktop and Allow other users to control your desktop (NB ignore command suggestion &#8211; we&#8217;ll just use Vinagre).<br \/>\n6.3 Create new user via Administration>Users and Groups.  This user will be the only one we allow to ssh in.  Give that user administrator rights<br \/>\n6.4 Change ssh settings to ONLY allow that new user access to the PC via ssh<\/p>\n<p>sudo gedit \/etc\/ssh\/sshd_config<br \/>\nadd new line on end and a blank line after it.  May need to reboot (may not).  NB sshd not ssh.<br \/>\nThe new line is AllowUsers new_user_name_here<br \/>\n6.5 Open ssh tunnel (port forwarding) on notebook. NB format is port:host:hostport.  When you connect to that port on the notebook it is directly connecting you to the hostport specified.<\/p>\n<p>ssh -L 5900:localhost:5900 new_username_on_dest@PC_IP<\/p>\n<p>NB I will need to do this each time I wish to use Vinagre to connect to the PC.  I open an ssh tunnel, and then use Vinagre to reach across it.  I will also need the following on the end of the command:<br \/>\n-p obscure_port<\/p>\n<p>6.6 Open Vinagre on notebook<br \/>\nApplications>Internet>Remote Desktop Viewer>Connect<br \/>\nHost: localhost<br \/>\nPort: 5900<br \/>\nThis works because I am directed to port 5900 on the remote computer (via the port forwarding I just set up in the terminal) and localhost is localhost on the PC of the host port.<\/p>\n<p>6.7 Do whatever is needed on the remote PC<\/p>\n<p>6.8 Close Vinagre (NB F11 to toggle in and out of fullscreen)<\/p>\n<p>6.9 Close ssh tunnel with<br \/>\nexit<\/p>\n<p>Step 7 &#8211; Setup PC in actual location with ADSL modem etc<br \/>\nHaving trouble connecting to the internet.  Able to connect to the ADSL modem from the PC using http:\/\/gateway_IP_address_here\/ so the ethernet connection, the power, and the modem are all working fine.  But pinging out doesn&#8217;t work.  Fixed that.  Odd setting required.  Printer and scanner installed extremely easily.  Much better than competing OS&#8217;s ;-).<\/p>\n<p>Step 8<\/p>\n<p>8.1 Thunderbird files<br \/>\nCopied old thunderbird folders across from windows (it worked!). Use sudo cp &#8230; and copy and paste the location.  To copy all contents of a folder use -r or -R and &#8220;path name\/with gaps\/&#8221;*  Will find everything in Ubuntu in \/home\/user_name\/.mozilla-thunderbird\/gobbledegook.default\/Mail.  Ctrl H to see hidden folders etc.  <\/p>\n<p>Even if a folder does not have subfolders, you must use the -r.  Otherwise you get something like cp: omitting directory yadda yadda. <a href=\"http:\/\/www.tuxfiles.org\/linuxhelp\/dirman.html\">http:\/\/www.tuxfiles.org\/linuxhelp\/dirman.html<\/a><\/p>\n<p>NB copy and paste the gobbledegook because it can be hard to get it exactly right just by reading it &#8211; example reason &#8211; Lowercase L (l) not = numeral one (1) even though in some fonts they are very similar!!!!!!!  The windows location is Documents and Settings\/user_name\/Application Data\/Thunderbird\/Profiles\/gobbledegook.default\/Mail.  It may be necessary to unlock the folders copied across so use sudo chmod 777 -R path_to_unlock_recursively<\/p>\n<p>8.2 Thunderbird address book<br \/>\nCopy the file abook.mab from &#8230; oldpc &#8230; \/Documents and Settings\/user_name\/Application Data\/Thunderbird\/Profiles\/gobbledegook.default\/&#8221; to \/home\/user_name\/.mozilla-thunderbird\/gobbledegook.default\/<\/p>\n<p>8.3 Firefox 2 bookmarks into Firefox 3<br \/>\nThis only required opening Firefox 3, Bookmarks>Organise Bookmarks>Import HTML and importing the stored bookmarks.html file from &#8230; oldpc &#8230; \/Documents and Settings\/user_name\/Application Data\/Mozilla\/Firefox\/Profiles\/gobbledegook.default\/&#8221;.  Restart Firefox.<\/p>\n<p>ROUTINE USE:<br \/>\nopen secure shell in:<br \/>\nssh -L 5900:localhost:5900 new_user_name_on_dest@PC_IP -p obscure_port<br \/>\nThe PC_IP address will frequently change so try the last one and then ask user to visit www.showmyip.com and tell you the new one.  The obscure port was set in step 6.1.<br \/>\nFirst time with any new IP address will need to say yes (not y, Y etc) to RSA key creation.<br \/>\nOtherwise just need password for new_user_name_on_dest.<br \/>\n(NB to exit when finished)<\/p>\n<p>NB can work from the CLI for file management tasks etc.  Only open remote desktop viewer if seeing the screen (or user interaction) useful.<\/p>\n<p>The open remote desktop viewer (Vinagre) Internet>Remote Desktop Viewer<br \/>\nConnect:<br \/>\nlocalhost<br \/>\n5900<\/p>\n<p>NB performance not so good so use desktop when you have to and actual shell itself when you can.<br \/>\nTo get cursor I think it is is Ctrl-Alt.  NB fastest often to set desktop background to a colour while working on it and restore wallpaper at end.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The nasty virus infestation was the final straw and my father-in-law wanted to switch to Ubuntu. He wanted better security and peace of mind. Step 1 &#8211; Use live CD to check that Ubuntu works OK with hardware (monitor, printers, &hellip; <a href=\"http:\/\/p-s.co.nz\/wordpress\/windows-xp-died-welcome-ubuntu-hardy-heron\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[],"class_list":["post-35","post","type-post","status-publish","format-standard","hentry","category-open-source","category-ubuntu"],"_links":{"self":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/35"}],"collection":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/comments?post=35"}],"version-history":[{"count":15,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/35\/revisions"}],"predecessor-version":[{"id":75,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/35\/revisions\/75"}],"wp:attachment":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/media?parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/categories?post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/tags?post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}