/docs/RemoteDebugging.txt

http://github.com/graemeg/lazarus · Plain Text · 88 lines · 56 code · 32 blank · 0 comment · 0 complexity · 1353c4ea81c4a1554e15a01c24a3559e MD5 · raw file

  1. Remote Debugging
  2. ================
  3. * Remote debugging is under construction *
  4. Remote debugging means you work on your local computer and you want to start
  5. and debug a program on another computer, the remote machine. In the following
  6. examples the name of the local computer is 'localcomp' and the name of the
  7. remote computer is 'remotecomp'.
  8. 1. Using ssh (secure shell)
  9. ssh (SSH client) is a program for logging into a remote machine and for
  10. executing commands on a remote machine. It is intended to replace rlogin
  11. and rsh, and provide secure encrypted communications between two
  12. untrusted hosts over an insecure network. X11 connections and arbitrary
  13. TCP/IP ports can also be forwarded over the secure channel.
  14. See the ssh man page for details.
  15. This text only handles ssh protocol 2. For differences for protocol 1 see the
  16. ssh man page.
  17. Requirements for lazarus:
  18. You must be able to log in via ssh to the remote machine (the computer where
  19. the program will run). This means the remote machine has an installed and
  20. running ssh server and you have an account allowed to login from your
  21. local machine (the computer where the lazarus IDE is running).
  22. You can test this by doing:
  23. []$ ssh username@remotecomp ls -la
  24. This will create a ssh connection to 'remotecomp' with the username
  25. 'username' and after authentification it will print out a directory listing
  26. and return.
  27. Configuring ssh:
  28. The IDE needs a ssh connection without prompting for a password. There are a
  29. lot of possibilities to achieve this. This text only describes a few. For
  30. security reasons it is strongly recommended that you read the ssh manpage.
  31. Solution 1: User based authentification.
  32. This will allow one specific user on the local computer to establish a ssh
  33. connection to the remote computer as a specific user without prompting for
  34. password.
  35. ToDo: describe the server settings. On redhat this works without any change.
  36. Step 1: create the rsa key on the local machine
  37. This will create two files on the local machine:
  38. ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub
  39. If you already have these files, skip this step.
  40. []$ ssh-keygen -t rsa
  41. Keep the default and leave the passphrase empty.
  42. Step 2: copy the public rsa key of the local machine to the remote machine
  43. []$ scp ~/.ssh/id_rsa.pub user@remotecomp:remote.pub
  44. Step 3: create on the remote machine the file ~/.ssh/authorized_keys2
  45. []$ ssh user@remotecomp
  46. []$ touch ~/.ssh/authorized_keys2
  47. []$ chmod 600 ~/.ssh/authorized_keys2
  48. The chmod will set the permissions to only allow yourself to read the
  49. file. ssh wants this.
  50. []$ cat remote.pub >> ~/.ssh/authorized_keys2
  51. []$ rm remote.pub
  52. []$ exit
  53. Step 4: Test. You should now be able to login without password.
  54. []$ ssh user@remotecomp
  55. Step 5: Setup the ssh debugger in the IDE
  56. ToDo