home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / admin / 5030 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  16.5 KB

  1. Xref: sparky comp.unix.admin:5030 comp.unix.questions:11048 comp.unix.programmer:4646
  2. Newsgroups: comp.unix.admin,comp.unix.questions,comp.unix.programmer
  3. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!spool.mu.edu!sdd.hp.com!ux1.cso.uiuc.edu!m.cs.uiuc.edu!vela!wsu-cs!wsu-eng.eng.wayne.edu!upkar
  4. From: upkar@wsu-eng.eng.wayne.edu (Upkar Singh Kohli)
  5. Subject: SUMMARY: two questions
  6. Message-ID: <1992Sep14.183403.10382@cs.wayne.edu>
  7. Sender: usenet@cs.wayne.edu (Usenet News)
  8. Reply-To: upkar@eng.wayne.edu.UUCP (Upkar Singh Kohli)
  9. Organization: Wayne State University, Detroit
  10. Date: Mon, 14 Sep 1992 18:34:03 GMT
  11. Lines: 380
  12.  
  13. (sorry for the late summary)
  14.  
  15. Original questions
  16. ==================
  17.  
  18. 1. How do I disable echo (under UNIX) (for getting passwords)?
  19.  
  20. 2. What would be the best way to uniquely identify a networked machine
  21.    for software licensing?
  22. -----------------
  23.  
  24. Thanks to the following for responding to my query:
  25. (sorry if I missed anybody!)
  26.  
  27. guri@apogee.sps.mot.com (Gurvinder Singh Ahluwalia)
  28. guy@auspex.com (Guy Harris)
  29. boes@corona.AuE.com (Barry A. Boes)
  30. mdl@cypress.com (J. Matt Landrum)
  31. "Andrew Luebker" <aahvdl@eye.psych.umn.edu>
  32. phil@dgbt.doc.ca (Phil Blanchfield)
  33. eeimkey@eeiua.ericsson.se (Martin Kelly)
  34. cyerkes@jpmorgan.com (Chuck Yerkes)
  35. evan@flatiron (Evan L. Marcus [Fusion Systems Group, Ltd.])
  36. Tom Conroy <trc@NSD.3Com.COM>
  37. Moustafa Hassan <hassan@cs.ubc.ca>
  38. VINCE@UCONNVM.UCONN.EDU
  39. Richard Elling <Richard.Elling@eng.auburn.edu>
  40. jdr@mlb.semi.harris.com (Jim Ray)
  41. poffen@sj.ate.slb.com  (Russ Poffenberger)
  42. David Fetrow <fetrow@pike.biostat.washington.edu>
  43. Robert L Krawitz <rlk@Think.COM>
  44. birger@vest.sdata.no (Birger A. Wathne)
  45. Chris Siebenmann <cks@hawkwind.utcs.toronto.edu>
  46. hooft@prl.philips.nl (Van Hooft PJG)
  47. Simon Coppins <coppins@arch.adelaide.edu.au>
  48. mike%pacsoft@uunet.UU.NET
  49. Per Thomsen <pthomsen@us.oracle.com>
  50. Mike Raffety <miker@sbcoc.com>
  51. gordon@sneaky.lonestar.org (Gordon Burditt)
  52. kalli!kevin@fourx.Aus.Sun.COM (Kevin Sheehan {Consulting Poster Child})
  53. mgfrank@avernus.com (Marc G. Frank)
  54. Casper Dik <casper@fwi.uva.nl>
  55. leon@orbot.co.il (Leon Koll)
  56. Dave Mitchell <D.Mitchell@dcs.sheffield.ac.uk>
  57. Tobias Weingartner <weingart@inf.ethz.ch>
  58. adam%bwnmr4@harvard.harvard.edu (Adam Shostack)
  59. hyder@niwot.scd.ucar.EDU (Paul Hyder)
  60. tdphette@mke.ab.com (Thad Phetteplace x4461)
  61. chris@visionware.co.uk (Chris Davies)
  62. nickel@desaster.cs.tu-berlin.de (Juergen Nickelsen)
  63. miguel@roxanne.nuclecu.unam.mx (Miguel de Icaza A.)
  64. tdphette@mke.ab.com (Thad Phetteplace x4461)
  65.  
  66.  
  67. 1. Answer to the first question was an overwhelming "Use getpass."
  68.    This is sufficient except if the input is more than 8 characters
  69.    then this fails. Some responses included other ways such as
  70.    using "curses" and "ioctl."
  71.  
  72. 2. In essence most of the responses to the second question referred 
  73.    to usage of "hostid" "ethernet address" and/or "IP address." All 
  74.    these can be faked in one way or the other... There is no standard 
  75.    solution. Some responders did not like the idea of uniquely identifying a
  76.    machine because that is usually an overhead when a customer
  77.    needs to switch a software license from one h/w to another.
  78.    
  79.    Floating license is the closest solution in my case, however
  80.    that can be easily cheated too! Well, trust your users.
  81.  
  82.  
  83. Unique Responses (question 1)
  84. =============================
  85.  
  86. If it is available on your system, you shoulkd use the curses library
  87. ,
  88. because it is the easiest and most portable way: noecho() and echo().
  89. But if you want to read a password, you can use the getpass()
  90. function.
  91. --------------------
  92.  
  93. getpass(3) is one way of doing it, another one has to do with ioctl(2
  94. )
  95. system calls (indeed, you must mimic stty -echo).
  96. --------------------
  97.  
  98. Check out the man page on the function getpass.  If you want to do al
  99. l the
  100. character IO yourself, look up the functions cbreak, nocbreack, echo,
  101.  noecho
  102. (these are all part of the curses screen library).  I'd be willing to
  103.  mail
  104. you examples if you like.
  105.  
  106.  
  107. Responses (question 2)
  108. ======================
  109.  
  110. Suns running DNA (Sun's DECnet stack) acquire a different ethernet
  111. address (one with the AA:00:04:00:XX:XX DECnet convention) which
  112. is then used for TCP/IP communication as well.
  113. --------------------
  114.  
  115. If the purpose is to do software licensing, the best way is to have a
  116. network license server, rather than relying on machines having a unique
  117. identifier.  Yes, Ethernet addresses can be changed on many machines. 
  118. Yes, host IDs can be changed on many machines, and even on some where it
  119. can't be changed in a vanilla system, anybody sufficiently knowledgable
  120. about the way the OS works can set their system up to return a fake host
  121. ID.
  122. --------------------
  123.  
  124.    Sure, the ethernet, hostid, and anything else on a sun can be
  125. "faked" if the person trying it knows what they're doing.  If you want
  126. to protect your software on a single user, non-networked platform,
  127. there's not much you can do to prevent a smart individual from
  128. circumventing the protection.
  129.   However, if the client has networked machines, which is almost
  130. always the case for suns, I think the best method of protection for
  131. fixed node software is to check the machine name and internet address.
  132. Someone could STILL get around that, but it's much more difficult, as
  133. changing the calls that return a machines internet address or name can
  134. cause the machine to become confused.
  135.   There is some pretty good bundled licensing software available for
  136. suns, lmgr, which is used by Frame, Cadence, Mentor, and several
  137. others.  It's pretty good protection, but one disadvantage of using a
  138. package like that is that if someone has figured out how to trick it
  139. for one application, they can trick it for all of them.
  140. --------------------
  141.  
  142. It is true for hostids, although you need to know
  143. something about the kernel.  As for the most effective way...
  144. it depends on if the software costs more for different
  145. architecures, etc.  The most effective way for me as a user
  146. would be by internet number so if for some reason I need to
  147. swap a CAD and Design machine, I can easily have the software
  148. stay in the appropriate place.
  149. --------------------
  150.  
  151. I think the boot PROM's also have a serial number.
  152. --------------------
  153.  
  154. Everybody seems to use the hostid. The hostid lives in a non volatile
  155. ram thing (EEPROM?) on the motherboard. It can be changed in the running
  156. kernel if you know where it is.
  157. --------------------
  158.  
  159. Have you tried the command "hostid" and/or the system 
  160. call "gethostid()" ?
  161.  
  162. They both return a numeric hex identifier (same one) for the current 
  163. host. This hex number is unique across all Suns and is stored in the 
  164. PROM or NVRAM chip on the CPU board.
  165. --------------------
  166.  
  167. With SunOS coming out on platforms without host chips,
  168. they do not recommend relying on chip based licensing.
  169. Call sun, they make their own policies, no mailing lists.
  170. --------------------
  171.  
  172. Yes, Ethernet address can be easily changed.
  173.  
  174. The most common way to uniquely identify a Sun workstation is to use
  175. hostid(1).
  176. --------------------
  177.  
  178. Why do you want to identify the hardware? Are you not more interrested
  179. in identifying a particular 'node' or 'host entity' or somesuch?
  180. Actually, you probably just want to ensure that somebody does not
  181. use a software package on more stations than they have paid for the
  182. priveledge of using the software on.
  183.  
  184. Using hardware specific id's such as `hostid` or MAC address make it
  185. a real pain in the patookus when you need to swap hardware due to
  186. an upgrade or repair/replacement.
  187.  
  188. Personally, I would use the network protocol address (if unique).
  189. In the case of IP, the IP address is certainly a unique feature
  190. of a station on a network and could be used to lock a license to
  191. a node. Of course, if the station is not on a network, then all bets
  192. are off.
  193.  
  194. The floating license servers seem to work out quite well. In this
  195. scenario, a limited number of licenses are available and any station
  196. may 'check out' an available license.
  197. --------------------
  198.  
  199. I hope that you get lots of objections to this post. The way to do is
  200. through a contract. If you assume your customers are going to rip you
  201. off, and you want to make sure that they don't ever use your software on
  202. a non licensed machine, you are going to cause honest people a lot of
  203. trouble. We bought exactly two such packages, and they caused quite a bit of
  204. of hassle. And we never tried to steal anything.  I will avoid, if at all     i
  205. possible, any cpu locked software.
  206. --------------------
  207.  
  208. Yes.  As long end users have access to the kernel, there is nothing
  209. they can't change.  Also, the hostid is stored in NVRAM which can
  210. be easily reprogrammed.
  211.  
  212. hostid is still your best bet.  Or a combination of hostid/IP address.
  213. However, your company had better have a flexible policy for when people
  214. want to reconfigure their network.  Also, since this is a world
  215. community, you'd need to be able to staff a phone line for reconfiguring
  216. networks nearly 24 hours a day.
  217.  
  218. Alternatively, you may elect to go with an external box connected to the
  219. serial port.  This is the only effect means of copy protecting still
  220. used in the PC market.  This method is doomed for networks since you
  221. still won't have the ability to run the program from other networked 
  222. machines.
  223.  
  224. Some sites are developing policies against buying node-locked software.
  225. So you might consider a floating license manager such as the Highland
  226. License manager.
  227. --------------------
  228.  
  229. Hostid is probably your best bet.  Quite a few vendors ( software ) use the hostid
  230. to license software.  Ethernet hardware address is not a good choice due to the
  231. ability to change this at boot.
  232. --------------------
  233.  
  234. The hostid is about the only way. I suppose you could access the ethernet
  235. address in the ID prom, but that is the same place as the hostid, so it
  236. probably doesn't matter.
  237. --------------------
  238.  
  239.  hostid is a unique serial number built into the ROMS. There is a way around it
  240. (of course. There always is).
  241. --------------------
  242.  
  243. Yup (at least it was on 3/50's, and I'd be surprised if it's not
  244. possible on later series machines).  We once did it legally, because a
  245. certain application was node licensed and we negotiated a site license,
  246. but the vendor hadn't fixed the licensing scheme, so they let us change
  247. the hostid's for that purpose.
  248.  
  249. There probably is no way, in the face of determined opposition.
  250. --------------------
  251.  
  252. hostid's are bound to the PROM. They cannot be changed (Unless the customer
  253. is desperate enough to decode the PROM and burn new ones).
  254.  
  255. Ethernet addr. is set from the hostid. Thus all ethernet interfaces
  256. on the same host use the same ethernet address. But it can be
  257. changed with ifconfig ether ....
  258.  
  259. Just make shure the routines you use to read the hostid are not
  260. dynamically linked.....
  261.  
  262. And perhaps look into using one of the commercially available license managers
  263. on the market. Network licensing with floating licenses is the way to go.
  264. I think Sun's SunNet License is really the Highland license manager.
  265. --------------------
  266.  
  267.  You aren't going to like this: there isn't one. IP address(s) of the
  268. machine are about as close as you can come (don't forget that some
  269. machines have more than one, and some have none).
  270. --------------------
  271.  
  272. Unfortunately, this is a field on which there is no portable solution.
  273.  
  274. Suns, for example have a fixed hostid that you can use. On other machines
  275. you have to use the ethernetaddress. Since, as you mentioned, you can 
  276. change the effective ethernetaddress, you have to go for the default
  277. address, that is burned in the ethernet interface itself.
  278.  
  279. But to avoid all these problems, I would like to suggest you use
  280. a commercial licensing system, eg netls. 
  281. --------------------
  282.  
  283. Try /usr/bin/hostid.
  284. --------------------
  285.  
  286. No software licensing method is very effective.  Why not simply
  287. trust your users to do the right thing?
  288. --------------------
  289.  
  290. This is a tougher one; the ethernet address (as opposed to the IP address is 
  291. not all that easy to change, and on some architectures it can't be changed without
  292. burning a new PROM for the network board. So, depending on how secure you want to
  293. be, you can use the ethernet address.
  294.  
  295. Another possibility is to use the serial number of the machine, if you can get
  296. at it. I'm afraid I don't know how to get a hold of it for any architecture 
  297. (through software), but maybe the vendor will tell you.
  298. --------------------
  299.  
  300. There's no sure-fire way ... I know how to change a hostid, though it's
  301. rather more complicated than changing the Ethernet address (it requires
  302. a binary patch to the kernel code, typically with adb).  Most vendors
  303. just use the hostid anyway, though you could also possibly factor in
  304. things like IP address, hostname, and/or Ethernet address.  The more
  305. factors, of course, the more your customer won't like it, and the more
  306. requests you'll get from customers for a new key, because one or the
  307. other factor changed (e.g., new CPU board, new network, new hostname, etc.).
  308.  
  309. Many also do network broadcasts, looking for other similar licensing
  310. daemons; if it finds one, it exits, helping ensure there aren't multiple
  311. license daemons running on any one network.
  312. --------------------
  313.  
  314. Use an identifier in a piece of hardware that cannot break or
  315. malfunction.  (Unfortunately, there is no such thing.  The alternative 
  316. is not to sell to people you don't trust.)
  317. --------------------
  318.  
  319. Kind of - you can't change the prom version of hostid, but you can
  320. change what the kernel returns for an answer.  What I use is a combination
  321. of the two.  It is very rare that people change the ethernet address,
  322. and if they do it on the fly to install software, lots of things will
  323. break.  At any rate, you can encrypt the info you stored for both,
  324. and make sure it doesn't change...  Some packages broadcast their
  325. info in an encrypted form so that other packages of the same flavor
  326. can detect dups...
  327.  
  328. This is one reason that we are investigating using public key algorithms
  329. for this instead.
  330. --------------------
  331.  
  332. How about the IP number?
  333. --------------------
  334.  
  335. There is no ``easy'' way to change the hostid of a Sun. But remember,
  336. with enough time and effort, anything can be changed. Linking a new
  337. system call in the kernel to change or set the hostid is possible.
  338. Or using ptrace/PTRACE_SYSCALL to intercept calls to gethostid()
  339. and return your own special value (I've written a program to do
  340. this once). Since the software interface is all a program has access to,
  341. there will always remain ways in which any a scheme can be subverted.
  342.  
  343. The hostid is probably your best bet, although using the IP address or
  344. fully qualified hostname is much friendlier. If you use the IP
  345. address, faking will be much harder. Changing is possible, but
  346. not on the network with other hosts with the same IP address.
  347. Since networks can be world-wide, this gives you some protection.
  348. Also, if a host breaks down, it can easily be replaced without having
  349. to redo the license. Same with hardware upgrade. Hostname, at least
  350. the Fully Qualified Domainname, gives much the same protection as
  351. IP address but has the added advantage from the perspective of the
  352. software buyer that machines can be re-IP numbered (not an uncommon
  353. occurrence when moving or getting internet connectivity or when switching
  354. from multiple C nets to one B net or etc ...) without having to reacquire
  355. a license. A license policy for important application that depends
  356. on certain hardware that can be replaced almost immediately when it breaks,
  357. must be accompanied with license update service with the same speed
  358. as the hardware service to minimize effective downtime.
  359. --------------------
  360.  
  361. offically, hostid cant be changed; in practice, it can be changed by a simple
  362. kernel hack (ie using adb).
  363. --------------------
  364.  
  365. Depends, how portable do you want it to be?
  366. --------------------
  367.  
  368. If your intent is to "absolutely positively" protect software by
  369. restricting it to a single host you are out of luck.  Although not
  370. easy, it is possible to change the almost anything including the
  371. hostid on any UNIX platform.  This includes one case that I saw where
  372. a facility had all the hostid's set to the same number.  (This was long
  373. ago but is still easily done with kernel patches.)
  374.  
  375. The best solution is to implement some type of active user license
  376. server based process (even for a single copy!) and avoid the hostid
  377. restriction attempt completely.  This makes happy users too, hardware
  378. tends to move around these days and shifting licenses is truly a 
  379. pain.
  380.  
  381. Course, if you trust users or sell to a low technology user community
  382. hostid is not a bad choice if you really gotta host restrict.
  383.     Paul Hyder
  384. --------------------
  385.  
  386. Can't help you here.  Vendors haven't seemed to standardized on anything yet.
  387. I recommend you make the licensing code a tightly enclosed module that can be
  388. customized for each hardware platform.
  389. --------------------
  390.  
  391. There isn't one (unless you're using a VAX, in which case you can read
  392. the CPU serial number).
  393.