Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. <Algebr> I am writing an ssh library and need the a local ssh server to test
  2. against. I turned it on in Remote login under system preferences but
  3. when I check who is listening on port 22 I get nothing. [09:39]
  4. <Algebr> but I know its working cause I can do ssh <name>@localhost just fine
  5. [09:40]
  6. <mwilson> "check who is listening"? [09:41]
  7. <Algebr> The server part of ssh listens on port 22, usually. [09:43]
  8. <mwilson> Thank you, I'm not a moron. I was more interested in what you
  9. thought you meant by "check who is listening".
  10. <Algebr> Touchy. I use this shell function, who_on_port () { [09:44]
  11. <Algebr> lsof -n -i4TCP:$1 | grep LISTEN
  12. <Algebr> }
  13. <Algebr>
  14. <Algebr>
  15. <shauno> sshd should be launched on demand by launchd [09:46]
  16. <shauno> eg, you should notice it's missing from the process list when you're
  17. not connected to it either
  18. <mwilson> The only thing that's running all the time is ssh-agent
  19. <Algebr> Okay, then how is ssh name@localhost working? [09:47]
  20. <mwilson> So you didn't actually bother to read what he said, or anything?
  21. <Algebr> ? [09:48]
  22. <mwilson> shauno: Linuxer. [09:49]
  23. <Algebr> shauno: can i force it to be on now, all the time at least for
  24. debugging.
  25. <mwilson> shauno: But he's "writing a ssh library", whatever he thinks he
  26. means by that.
  27. <Algebr> It means I'm writing OCaml bindings to libssh, does that even matter?
  28. [09:50]
  29. <Algebr> What is up with this channel
  30. <mwilson> How sshd works on OS X isn't going to change, I point out to you
  31. that if you can't deal with it, it is you who has the problem, not
  32. the other way around.
  33. <shauno> have you ever used inetd or xinetd? [09:51]
  34. <Algebr> no
  35. <shauno> hm. that'd make it easier to explain, since they're the closest
  36. parallels
  37. <Algebr> Okay will look it up. What did the GUI checkbox do then? [09:52]
  38. <mwilson> What it says it does. Enable Remote Login.
  39. <shauno> launchd can watch incoming connections and pass them off to on-demand
  40. services [09:53]
  41. <mwilson> This is a technique at least 20 years old.
  42. <shauno> yeah. that's what inetd was doing too
  43. <Algebr> shauno: Can I force it to be up all the time instead of on-demand?
  44. <mwilson> Yes, but he's a Linuxer, you can't expect him to understand it.
  45. [09:54]
  46. <turtle_> you could write your own launchd plist and run sshd how ever you
  47. want
  48. <shauno> the catch is that launchd is close enough to the kernel that other
  49. processes won't actually see it listening
  50. <mwilson> Algebr: If you think you need to have sshd running all the time, it
  51. is you who have the problem.
  52. <mwilson> Algebr: Again, if whatever you think you're creating has that
  53. requirement, it is fundamentally broken on OS X. [09:55]
  54. <shauno> yeah, it would need pretty much a complete rewrite of
  55. /System/Library/LaunchDaemons/ssh.plist
  56. <shauno> but as mwilson so tactfully puts it, it really shouldn't matter. you
  57. try to connect, a daemon spawns and accepts the connection. there
  58. should be no noticable difference in behaviour [09:56]
  59. <mwilson> shauno: You'd think in 2015, software could deal with inetd/xinetd
  60. techniques.
  61. <Algebr> This is a very unfriendly and rude channel. Thanks shauno for the
  62. pointers.
  63. ERC>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement