个人工具

UbuntuHelp:RemoteConnectionUbuntuLiveCD

来自Ubuntu中文

跳转至: 导航, 搜索

Note: This process is risky and untested THIS IS A ROUGH DRAFT AND NEEDS TO BE CHECKED, BUT SHOULD WORK

Connecting over ssh to a Ubuntu Live Distribution

This guide may be handy if you have to help a less-technical remote friend recover data when his Windows computer became corrupted/damaged (as I had to). We used Ubuntu's great Live CD and I was able to help him by logging in and moving everything to a USB disk.

Remote Computer

First, you need an Ubuntu Live CD for the remote computer. Start the computer with the CD in the drive, checking the BIOS if the computer does not start to the CD-Drive. I prefer to ask people to use the command prompt, as there are less steps (though more letters!). The remote user should start the root terminal, and type in

sudo apt-get install ssh

answering yes to the question about installing extra packages. Next, add a password for the root account:

sudo passwd root

and typing a password (twice) for the root user. NOTE: Using the root account is traditionally a bad idea, but since you will be using a Live distribution, as long as you don't delete important files, this lazy man's approach is OK.

IP Address

You will need to know their ip address. The easiest way for them to find this out is to go to have them view, in their browser, www.whatismyip.com. They should tell you this number.

NAT/Router

If they have a router, they may need to open up their router to allow external access - the most complicated step for them. The remote user needs to type in ifconfig in the command prompt. They should see something like

eth0      Link encap:Ethernet  HWaddr 00:E0:22:51:89:A3  
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0

where 192.168.1.101 (or something like it) is their IP address. Depending on what router you have, you will need to open up either port 25 for ssh or put the whole computer in the DMZ zone. Whichever option you choose, make sure you close the ports when you are all done! An alternative to reconfiguring the NAT router is to use Hamachi. Hamachi is a tool to set up a VPN with minimal effort. Installation is straightforward and hamachi comes in a single package, so it's easy to move around. See the web site for more information.

Connecting

From your computer, be it Ubuntu or Mac OSX Terminal or Windows Putty, type ssh root@theiripaddress using the number they saw at whatismyip.com. Enter the password your friend typed in minutes ago, and you are in the system.

Moving around

If Ubuntu has not mounted their Windows partition, you can do it with

mkdir /media/windows
mount /dev/hda1 /media/windows/ -t ntfs -o umask=0222

You may need to mount their USB Flash Disk or network share (or other media), and from here you can copy selected files off their bad system.