File: answer.html

package info (click to toggle)
lg-issue15 2-3
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 1,448 kB
  • ctags: 122
  • sloc: ansic: 113; makefile: 30; sh: 3
file content (1636 lines) | stat: -rw-r--r-- 63,007 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> 
<html>
<head>
<title>The Answer Guy Issue 15</title>
</head>

<BODY>
<H4>&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>
<P> <hr> <P> 

<!-- =====================================================================  -->
<center>
<H1><A NAME="answer">
<img src="../gx/ans.gif" alt="" border=0 align=middle>
The Answer Guy
<img src="../gx/ans.gif" alt="" border=0 align=middle>
</A></H1> <BR>
<H4>By James T. Dennis,
<a href="mailto:jimd@starshine.org">jimd@starshine.org</a><BR> 
Starshine Technical Services, <A HREF="http://www.starshine.org/">
http://www.starshine.org/</A> </H4> 
</center>

<p><hr><p>
<H3>Contents:</H3>
<ul>
<li><a HREF="./answer.html#fetch">fetchmail and POP3 Correction</a>
<li><a HREF="./answer.html#auto">Automated File Transfer over Firewall</a>
<li><a HREF="./answer.html#chown">chown Question</a>
<li><a HREF="./answer.html#copy">Copy from Xterm to TkDesk</a>
<li><a HREF="./answer.html#file">File System Debugger</a>
<li><a HREF="./answer.html#ipfrag">IP Fragmentation Attack Description</a>
<li><a HREF="./answer.html#mail">Mail Server Problem</a>
<li><a HREF="./answer.html#send">Mail and Sendmail</a>
<li><a HREF="./answer.html#mount">Mounted vfat File Systems</a>
<li><a HREF="./answer.html#pop">POP3 E-Mail</a>
<li><a HREF="./answer.html#pseudo">Pseudo Terminal Device Questions</a>
<li><a HREF="./answer.html#root">root login Bug in Linux</a>
<li><a HREF="./answer.html#again">Sendmail-8.8.4 and Linux</a>
<li><a HREF="./answer.html#wuftpd">wu-ftpd Problems</a>
</ul>

<p><hr><p> 
<!--================================================================-->

<a name="fetch"></a>
<h3><img align=bottom alt=" " src="../gx/ans2.gif">
fetchmail and POP3 Correction
</h3>
<P> <B> 
From: Eric S. Raymond, <A HREF="mailto:esr@snark.thyrsus.com">esr@snark.thyrsus.com</A>
</B> <P><B>  
One of your answers in this month's letters column was slightly in
error.
</B> <P><B>  
Fetchmail no longer has the old popclient option to dump
retrieved mail to a file; I removed it.  Fetchmail, unlike its ancestor
popclient, is designed to be a pure MTA, a pipefitting that connects a
POP or IMAP server to your normal, SMTP-based incoming-mail path.
</B> <P><B>  
Fetchmail's "multidrop" mode does what Moe Green wants.  It allows
fetchmail, in effect, to serve as a mail collector for a host or
subdomain.
</B> <P><B>  
Fetchmail is available at Sunsite, under the system/mail/pop
directory.
<a href="http://www.ccil.org/~esr">Eric S. Raymond</a>
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	Eric is the author (compiler) of _The_New_Hackers_Dictionary_
	a maintainer of the Jargon file (on which the NHD is based)
	and is the current maintainer of the termcap file that's
	used by Linux (and probably other Unix' as well).

	He's also the author of 'fetchmail'
-- Jim
<p><hr><p> 
<!--================================================================-->

<a name="auto"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Automated File Transfer over Firewall
</h3>
<B> 
From: Koen Rousseau, <A HREF="mailto:koen@kava.be">koen@kava.be</A> 
</B> <P><B>  
Hi,<BR> 
Because of the security risk involved when using rcp,
I disabled this service on our linux host. But the
main advantage of rcp (over the more secure ftp) is
that you can run it non-interactively (from cron
for example). Is there a way to "simulate" this
functionality with ftp?
</B> 
<P>
<img align=bottom alt=" " src="../gx/ans2.gif">
	Technically non-anonymous ftp isn't 
	more secure than rcp.  The security
	concerns are different.  (Unless you're 
	using the "guestgroups" feature of wu-ftpd).  
	Under some circumstances it is less so.  
<P> 
	FTP passes your account password across
	the untrusted wire in "clear text" form.
	Any sniffer on the same LAN segment can
	search for the distinctive packets that mark
	a new session and grab the next few packets --
	which are almost certain to contain the password.
<P> 
	rcp doesn't send any sort of password.  However
	the remote host has to trust the IP addresses
	and the information returned by reverse DNS 
	lookups -- and possibly the responses of the
	local identd server.  Thus it is vulnerable
	to IP spoofing, and DNS hijaacking attacks.
<P> 
	Ultimately any automated file transfer will
	involve storing a password, hash or key on each
	end of the link or it will involve "trusting"
	some meta information about the connection (
	such as the IP address or reverse DNS lookups
	of the incoming connections).  
<P> 
	If the initiating host is compromised it can
	always pass bad data to the remote host (the 
	target of the file transfers).  If the 
	remote host (the target) is compromised it's 
	data can be replaced.  So we'll limit our 
	discussion to how we can trust the wire.
<P> 
	I'd suggest that you look at ssh. Written 
	by Tatu Ylongen, in Europe (Finland?) this 
	is a secure replacement for rsh.  It comes 
	with scp (a replacement for rcp).
<P> 
	ssh uses public key cryptographic methods for 
	authentication (RSA) and to exchange a random 
	session key.  This key is then used with a 
	symmetrical algorithm (IDEA or your choice among
	others) for the end-to-end encryption through out 
	the session.  
<P> 
	It is free for non-commercial use.  You can grab
	a copy from ftp.cs.hut.fi (if I remember correctly)
	or via http://www.cs.hut.fi.  If you are in the 
	U.S. you should obtain a copy of the rsaref library
	from mit.edu (I don't remember the exact hostname there)
	and compile against that (this is to satisfy the patents
	license from RSA).  If you need a commercial license for
	it you should contact Data Fellows -- look at those web
	pages for details -- or look at http://www.ssh.com.
<P> 
	This combination may seem like overkill -- but
	it is necessary over untrusted wires.
<P> 
	It is possible to run rdist (the remote file 
	distribution program) over an ssh link.  This will 
	further automate the process -- allowing you to 
	push and pull files from or to multiple servers,
	recurse through directories, automate the removal
	of files, and only transfer new or changed files.
	It is significantly more efficient than just rcp
	scripts.
<P> 
	There are other methods by which you can automate
	file transfers within your organization.  One which
	may seem downright baroque is to use the venerable old
	UUCP.
<P> 
	UUCP can be used over tcp.  You create accounts on each host
	for each host (or you can have them share accounts in various
	combinations -- as you like).  In addition to allowing 
	cron driven and on demand file transfers using the 'uucp'
	command (which uses the UUCP protocols -- if you catch the
	distinction) you can also configure specific remote scripts
	and allow remote job execution to specific accounts.
<P> 
	UUCP offers a great deal of flexibility in scheduling
	and job prioritization.   It is extremely automation friendly
	and is reasonably secure (although the concerns about 
	text passwords over your ethernet are still valid).
<P> 
	You could also use a modern kermit (ckermit from Columbia
	University) which can open sessions over telnet and perform
	file tranfers through that.  kermit comes with a rich
	scripting language and is almost universally support.
<P> 
	It is also possible -- if you insist on sticking with
	ftp as the protocol -- to automate ftp.  You can use
	the ncftp "macro" feature by putting entries in the
	.ncftprc file.  This allows you to create a "startup"
	macro for each host your list in your rc file.  It is 
	possible to have multiple "host" entries which actually
	open connections to the same host to do different operations.
<P> 
	It is also possible to use 'expect' with your standard 
	ftp client shell. Expect is a programming languages built
	around TCL which is specifically focused on automating
	interactive programs.
<P> 
	Obviously these last three options would involve 
	storing the password in plain text on the host in 
	the script files.  However you can initiate the 
	connection from either end and transfer files both
	ways.  So it's possible to configure the more 
	secure host to initiate all file transfer sessions
	(the ones involving any password) and it's possible
	to set up a variety of methods for the exposed host
	to request a session.  (an attacker might spoof a 
	connection request -- but the more secure host 
	will only connect to one of it's valid clients -- 
	not some arbitrary host.
<P> <B> 
<img align=bottom alt=" " src="../gx/ques.gif">
Example 1: <BR> 
Internet users can upload a file on our public linux
host on the Internet. A cron job checks at 10 minute
intervals if there are files in the incoming files
directory (eg /home/ftp/incoming). If there are files,
they would be automaticaly transfered to another
host on our secure network (intranet) for further
processing. With rcp this would be easy, but rcp
is not a secure service, so can not be allowed on a
public Internet host. It's "competitor", ftp, is more
secure, but can it be done?
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	This is a "pull" operation. 
<P> 
	In this context ftp, initiated from the exposed
	host and going to a non-anonymous account on 
	your internal host, would be less secure than
	rcp.  (presuming that you are preventing 
	address spoofing at your exterior routers).
<P> 
	I'd use uucp over tcp (or even consider running
	a null modem if the hosts are physically close
	enough) and initiate session from the inside.
	TCP wrappers can be used to ensure that all 
	requests to this protocol come from the appropriate
	addresses (again, assuming you've got your anti-spoofing
	in place at the routers).
<P> 
	TCP wrappers should also be used for your telnet,
	ftp, and r* sessions.
<P> 
	The best security would be via rdist over ssh.
<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
Example 2: <BR> 
We extract data from our database on the intranet,
and translate them into HTML-pages for publishing
on our public WWW host on the Internet. Again,
we wish to do this automaticaly from cron. Normally,
one would use rcp, but for security reasons, we won't
allow it. Can ftp be used here?
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	This would be a "push" operation.
<P> 
	Exactly the same methods will work as I've discussed
	above.
<P> 
-- Jim

<p><hr><p> 
<!--================================================================-->

<a name="chown"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
chown Question
</h3>
<P><B>
From: Terry Paton, <A HREF="mailto:tpaton@vhf.nano.bc.ca">
tpaton@vhf.nano.bc.ca </A>
</B> <P><B>  
Hi Jim....<BR>
My question concerns the chown command. The problem that I have is as 
follows:
</B> <P><B>  
In a directory that I have access to I have several files that I own and 
also have group ownership. I want to change the ownership and group to 
something else. I am also webmastr and in the weaver group.
</B> <P><B>  
example: filename is country.html rw- rw- r tpaton owner tpaton group
</B> <P><B>  
I want to change to owner webmastr group weaver.
The command I used is chown webmastr.weaver country.html
The response the system gives is Operation not permitted.
</B> <P><B>  
Any ideas how come??
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	Of course.  Under Unix there are two approaches to 
	'chown' -- "giveaway" and "privileged only."  Linux
	installations almost always take the later approach
	(as do most systems which support quotas).
<P> 
	You want the 'chgrp' command.
<P> 
	You can use 'chgrp' to give group ownership of files 
	away to any group of which you are a member.
<P> 
	Another approach is to use the SGID bit on the
	directory.
<P> 
	If you have a directory which you share among several
	users -- such as a staging area for your web server --
	you can set that directory to a group ownership of a
	group (such as 'webauth') and use the 'chmod g+s' 
	to set the SGID bit.  On a directory this has a special
	meaning.
<P> 
	Any directory that is SGID will automatically set the 
	group ownership of any files created in that directory to
	match that of the directory.  This means that your 
	webauthors can just create or copy files into the directory 
	and not worry about using the chgrp (or chown) commands.
<P> 
	I suspect that this is what you really wanted.  Note:
	You'll want your web authors to adjust their umask to
	allow g+rw to make the best use of these features.  
<P> 
	Also note:  if this doesn't seem to work you might want to 
	check your /etc/fstab or the mount options on that filesystem.
	This behavior can be overridden with options to the mount 
	command and may not be available on some filesystem types.
	It is the default on ext2 filesystems.
<P> 
	There is also a special meaning to the "t" (sticky) bit
	when it is applied to directories.  Originally (in the
	era of PDP-7's and PDP-11's -- on which Unix was originally
	written) the sticky bit was a hint to the kernel to keep
	the images of certain executable files cached in preference
	to "non-sticky" files.  The sysadmin could then set this
	bit on things like "grep" which were used frequently --
	giving the system a slight performance boost.
<P> 
	Given modern caching techniques, usage patterns, and 
	storage systems the "sticky" bit has become useless on files.
<P> 
	However, most modern Unix systems still have a use for
	the 't' bit on directories.  It modifies the meaning of the
	"write" bit so that users with the write option to a directory
	can only affect *THEIR OWN* files.
<P> 
	You should always set the 't' bit on /tmp/ and similar
	(world-writeable) directories.
<P> 
	Perhaps, one of these days will find a use for the 't'
	bit on files again.  I don't know of a meaning for the SUID
	bit on directories (but there might be one in some forms
	of Unix -- even Linux).  Notice that "sticky" is not the
	same as SUID or SGID.  This is a fairly common misnomer.
<P> 
-- Jim


<p><hr><p> 
<!--================================================================-->

<a name="copy"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Copy from Xterm to TkDesk
</h3>
<P>
<B> 
From: Steve Varadi, <A HREF="mailto:svaradi@sprynet.com">svaradi@sprynet.com </A>
</B> <P><B>  
I have a question maybe someone know simpler solution for this.
I'm using TkDesk because very easy to use and most of the keystroke same
as in Win95.
If I want to copy something from xterm to an editble file I do
following:
</B> <ol>
<li>Select area in xterm
<li>Open Emacs
<li>Paste recent selection
<li>Save file 
<li>Open this file with TkDesk Editor and working with it comfortable
like in Win95 enviroment. 
 </ol>
<P><B>  
Is it any simpler procedure to copy something directly from xterm to
TkDesk Editor???
</B> <P><B>  
Thanks: Steve
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	The usual way to paste text in X is to use the 
	"middle" mouse button.  If you're using a two-button
	mouse you'd want your X server configured to 
	"Emulate3Buttons" -- allowing you to "chord"
	the buttons (press and hold the left button then
	click with the other).
<P> 
	I realize that this is different than Windows and 
	Mac -- where you expect a menu option to be 
	explicitly available for "Edit, Paste" -- but
	this follows the X principle of "providing 
	mechanisms" rather than "dictating policy"
	(requiring that every application have an 
	Edit menu with a Paste option would be a policy).
<P> 
	Personally I always preferred DESQview and 
	DESQview/X's "Mark and Transfer" feature -- which
	was completely keyboard drive.  It let me keep my
	hands on the keyboard and it allowed me to make
	interesting macros to automate the process.
	It was also nice because the application wasn't
	aware of the process -- if you could see text on
	your screen -- you could mark and transfer it.
<P> 
	However this sort of interface doesn't currently exist
	for Linux or XFree86 -- and I'm not enough of a programmer
	yet to bring it to you.  So try "chording" directly 
	into the text entry area of your TkDesk window after
	making your text selection.  Remember -- you'll probably 
	have to press on the left button first and hold it while
	clicking on the other button.  If you try that in the
	other order it probably won't work (never does for me).
<P> 
-- Jim

<p><hr><p> 
<!--================================================================-->

<a name="file"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
File System Debugger
</h3>
From: Steven Mercurio, <A HREF="mailto:stevenm@voicenet.com">stevenm@voicenet.com </A>
<P> <B> 
What I want to do is take apart the CURRENT filing system down to the
layout of the superblock.  On an AIX by IBM machine we used a program
called FSDB.  I just want to try and get my hands on it and the filing
system layout.
</B> <P>
<img align=bottom alt=" " src="../gx/ans2.gif">
	FSDB would probably be "filesystem debugger."
	The closest equivalent in Linux would probably be 
	the debugfs command.
<P>
	If you start this with a command like:
<P>
		debugfs /dev/hda1
<P>
	   ... it will provide you with a shell-like interface
	   (similar to the traditional ftp client) which provides 
	   you about forty commands for viewing and altering
	   links and inodes in your filesystem.  You can also 
	   select the filesytem you wish to use after you've
	   started the program.
<P>
	From the man page:
	       debugfs was written by Theodore Ts'o, tytso@mit.edu.
<P>
	There is another program that might be of interest to you.
	It's called lde (Linux Disk Editor).  This provides a 
	nice ncurses (with optional color) interface to many of the
	same operations.  You can find lde-2.3.tar.gz at any of 
	the Sunsite mirrors.
<P>
	There is yet another editor which is included with 
	some versions of Red Hat (and probably other distributions)
	called ext2ed.
<P>
	There are also FAQ's and HOWTO's on the ext2fs structure
	and internals available.
<P>
	Hope that helps.
<P>
-- Jim

<p><hr><p> 
<!--================================================================-->

<a name="ipfrag"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
IP Fragmentation attack description 
</h3>
<P> <B> 
From: Fabien Royer, <A HREF="mailto:fabien@magpage.com">
fabien@magpage.com </A> 
</B> <P><B>  
Hi all ! <BR> 
</B> <blockquote> <I><B> 
IP fragmentation is an old attack, used to send data to a port behind 
a packet filtering 'firewall'.
</B> </I> </blockquote>  <B> 
Now, wouldn't be possible to prevent an attack by packet fragmentation by
simply adding a second router that would receive and recheck the packets
reassembled by the first one ?
</B> <P><B>  
Regards, Fabien.
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	Most routers don't do reassembly and most packet 
	filtering systems don't track connections.  In 
	these each packet is judged purely on its own 
	merits.
<P>
	There is a newer, more advanced class of packet
	filtering packages which do "stateful inspection."
<P>
	These are currently mostly implemented in software on 
	various sorts of Unix systems.  From what I've heard
	these are largely experimental at this point.
<P>
	 For those that are curious there is a team working
	 on a "stateful inspection module" for the Linux 
	 2.x kernel.  The "IP Masquerading" features that are
	 built into this kernel (A.K.A. "Network Address 
	 Translation" or NAT) provide most of the support 
	 that's necessary to "stateful inspection." 
<P>
	 Here's a couple of links (courtesy of the Computer:
	 Security section of Yahoo, and Alta-Vista):
<P>
	 
	CYCON Labyrinth Firewall 1.4 Announcement 
		http://www.cycon.com/press/announce.html
	CheckPoint FireWall-1 Brochure 
		http://www.checkpoint.com/brochure/page6.html
	Network Address Translation 
		http://www.oms.co.za/overview/node2.html
	Firewall Overview 
		http://www.morningstar.com/secure-access/fw101.htm
	Freestone Firewall for Linux
		http://www.crpht.lu/CNS/html/PubServ/\
		Security/Firewall/FW_Mail/07-16_freestone_SOS
<P>
		(note: that last one is one long line).
<P>
	(There is also a package called the Mazama Packet Filters
	for Unix/Linux -but I didn't see if it supports the 
	"stateful" stuff).
<P>
	I didn't find anything on stateful packet filtering under
	NT -- but Checkpoint's Firewall-1 (listed above) is 
	available for NT -- and might support it.
<P>
-- Jim

<p><hr><p> 
<!--================================================================-->

<a name="mail"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
</h3>
Mail Server Problem
<P> <B> 
From: Panoy Tan
</B> <P><B>  
Hi,<BR> 
First let me say that I enjoy Linux Journal very much and get a lot 
out of every issue, esp. 'Letters to the Editor'.
If you have time to help me, I will be very glad and here is my 
trouble : 
My mail server run Linux Red Hat with kernel 2.0 and I use Netscape 
Mail  (POP-user) to read my e-mails on the server.
POP was designed to support "offline" mail processing, not "online" and 
"disconnected", therefor I have problem when I read my e-mails with 
different computers. That, I need, is my mails have to leave on the 
mail server, but whenever I delete one of my mails, which 
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	This has become a recurring problem in the years
	since POP (post office protocol) was created.
<P>
	You can configure most POP clients to keep your 
	mail -- but then you'll be downloading a new
	copy of every message to each machine -- each time
	you connect.
<P>
	Apparently (searching through Netscape's site) there
	is a hack to the POP3 protocol which would allow
	some of what you're looking for.  This appears to be
	called UIDL:  Here's what I read:
<P>
<A HREF="http://help.netscape.com/kb/client/960626-31.html">
             "The POP3 server does not support UIDL"</A>,
   Issue: 960626-31 Product: Navigator, Navigator Gold, Personal Edition,
                       Created: 06/12/96
<P>
	Unfortunately they didn't have any pointers to a 
	POP server with UIDL support.  A search at Yahoo!
	sent me straight to Alta Vista -- so a number of USENet
	and mailing list postings that referred to a variety of
	patches.  I'll leave that as an exercise to the reader.
<P> <B> 
<img align=bottom alt=" " src="../gx/ques.gif">
I have read, it will be delete from the server.
I have heard that IMAP supports 'online' mail processing and that is 
reason to my questions :
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	I've heard similar rumors.  The question I was trying
	to answer by looking at Netscape's site is whether they 
	support the client side of IMAP.  Here's some more
	background info:
<P>
	IMAP (Internet Mail Access Protocol) is intended to be
	a more advanced mail service.  The proposed standards
	are covered in RFC1730 through RFC1733 (which are 
	conveniently consecutive) and RFC2060.  You can search
	for RFC's at the ds.internic.net web site or use 
	ftp.isi.edu.
<P>
	RFC's are the documents which become the standards of the
	Internet.  They start as "requests for comments" and 
	are revised and into STD's (standards documents) and
	FYI's ("for your information" documents).  In the anarchy
	that is the 'net -- these are the results of the "rough
	consensus and running code" that gets all of our systems
	chatting with one another.
<P>
	I did a quick Yahoo search using the keywords IMAP and Linux
	and came up with the following:
<blockquote> 
<A HREF="http://www.imap.org/whatisIMAP.html">whatisIMAP?</A> 
   IMAP stands for Internet Message Access Protocol. It is a method of
   accessing electronic mail or bulletin board messages that are kept on
   a (possibly shared) mail server. In other words, it permits a "client"
   email program to access remote message stores as if they were local.
   For example, email stored on an IMAP server can be manipulated from a
   desktop computer at home, a workstation at the office, and a notebook
   computer while traveling, without the need to transfer messages or
   files back and forth between these computers.
<P> 
   IMAP's ability to access messages (both new and saved) from more than
   one computer has become extremely important as reliance on electronic
   messaging and use of multiple computers increase, but this
   functionality cannot be taken for granted: the widely used Post Office
   Protocol (POP) works best when one has only a single computer, since
   it was designed to support "offline" message access, wherein messages
   are downloaded and then deleted from the mail server. This mode of
   access is not compatible with access from multiple computers since it
   tends to sprinkle messages across all of the computers used for mail
   access. Thus, unless all of those machines share a common file system,
   the offline mode of access that POP was designed to support
</blockquote>
<P>
	There is *much* more info at this site -- I only clipped
	the first two paragraphs.
<P>
	Some related work is the ACAP (Application Configuration 
	Access Protocol) and the IMSP (Internet Message Support 
	Protocol) which are other drafts that are currently on 
	the table at the IETF (www.ietf.org).
<P>
	To quote another site that came up in my search:
<blockquote> 
<A HREF="http://andrew2.andrew.cmu.edu/cyrus/acap/">
   ACAP</A> is a solution for the problem of client mobility on the 
   internet. Almost all Internet applications currently store 
   user preferences, options, server locations, and other 
   personal data in local disk files. These leads to the 
   unpleasant problems of users having to recreate configuration 
   set-ups, subscription lists, addressbooks, bookmark files, 
   folder storage locations, and so forth every time they change 
   physical locations.
</blockquote> 
<P>
	If you're getting confused -- don't worry -- we all
	are.  I've been bumping into references to IMAP, and
	ACAP for a few months now.  They are pretty new and 
	intended to address issues that only recently grew 
	up to be problems for enough people to notice them.
<P>
	The short form is:  IMAP is an advanced protocol for 
	accessing individual headers and messages from a remote
	mail box.  ACAP (which I guess replaces or is built over
	IMSP) provides access to more advanced configuration
	options to affect how IMAP (and potentially other 
	remotely accessed applications) behave for a given account.
<P> <B> 
<img align=bottom alt=" " src="../gx/ques.gif">
1) Is there any IMAP to Linux, esp. Red Hat ?
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	There is an IMAP server included with Linux some
	Linux distributions (Red Hat 3.03 or later I suspect).
	I'm not sure about the feature set -- and the 
	man page on my Red Hat 3 system here is pretty sparse.
<P>
	However the server is not the real problem here.
	What you really need is a client program that can
	talk to your IMAP server.
<P> <B> 
<img align=bottom alt=" " src="../gx/ques.gif">
2) Where can I get it ?
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	The CMU (Carnegie-Mellon University) Cyrus IMAP project
	looks promising  -- so I downloaded a copy of that
	as I typed this and looked up some of these other references.
<P>
	It's about 400K and can be found somewhere at:
<P>
		ftp://ftp.andrew.cmu.edu/
<P> <B> 
<img align=bottom alt=" " src="../gx/ques.gif">
3) What must I be carefully when I install it ?
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	You must have a client that supports the IMAP features 
	that you're actually looking for.  It's possible to 
	have a client that treats an IMAP server just like a 
	POP3 server (fetchmail for example). It may be that
	Netscape's UIDL support is all you need for your
	purposes.
<P>
	I didn't find any reference to IMAP anywhere on
	Netscape's site -- which suggests that they don't 
	offer it yet.  I'm blind copying a friend of mine
	that is a programmer for them -- and specifically
	one who worked (works?) on the code for the mail
	support in the Navigator.  Maybe he'll tell me 
	something about this (or maybe it's covered by his
	NDA).
<P>
	I also looked at Eudora and Pegasus web pages and
	found no IMAP support for these either.  It was a 
	long shot since neither of these has a Linux port
	(so far as I know) -- and I doubt you want to run
	WABI to read all of your mail -- nor even DOSEmu
	to run the Pegasus for DOS.
<P>
	pine seems to support IMAP.  XF-Mail (a popular
	free X mail user agent) and Z-Mail (a popular
	commercial one) also seem to have some support.
	More info on IMAP clients is available at the 
	IMAP Info Center (see below).
<P>
	The most informative web sites I visited in my
	research for this question were:
<P>
	   Cyrus IMAP Server:  Overview and Concepts
		http://andrew2.andrew.cmu.edu/cyrus/cyrus-overview.html
	   The IMAP Information Center
		http://www.imap.org/
	   Draft IMSP Specification
		http://andrew2.andrew.cmu.edu/cyrus/rfc/imsp.html
	   The ACAP Home Page
		http://andrew2.andrew.cmu.edu/cyrus/acap/
	   Client-server mail protocols FAQ
		http://www.cis.ohio-state.edu/hypertext/faq/ \
		   usenet/mail/mailclient-faq/faq.html
<P>
	The most active discussion about UIDL seems to have been on 
	the mh-users mailing list.  Archives can be found at:
	http://www.rosat.mpe-garching.mpg.de/mailing-lists/mh-users/
<P> <B> 
<img align=bottom alt=" " src="../gx/ques.gif">
Thank you for your time to read my questions and hope to hear you 
soon.<BR> 
Regards, Nga   
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	It's a hobby.  I really only had about 2 hours to spare on this
	research (and I took about three) -- and I don't have an 
	environment handy to do any real testing.
<P>
	As I said -- I've been bumping into references about 
	IMAP and ACAP and wanted to learn more myself.  At the last
	IETF conference (in San Jose) I had lunch with one of the
	sysadmins at CMU -- who talked a bit about it.
<P>
	Sorry this article is so rambling and disorganized.  
	I basically tossed it together as I searched.
	
	To paraphrase Blaise Pascal:
<blockquote> 
		This letter is so long because I lack the
		time to make it brief.
</blockquote> 
-- Jim

<p><hr><p> 
<!--================================================================-->

<a name="send"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Mail & Sendmail 
</h3>
<P> <B>
From: Franaur P. Tan, <A HREF="mailto:noy@ayala.com.ph">noy@ayala.com.ph
</A>
</B> <P><B>  
Hi There, <BR> 
I just read your article on Linux Gazette, got a lot of
good tips on securing my Linuz machine, thanks.  Like
always, I have one bit of question I was hoping you could
answer, I'd like to send mail from my Linux machine w/o
installing sendmail, and I need this e-mail to be sent
by a script initiated by crond.
</B> <P><B>  
Right now (w/ sendmail installed) I can do it with
a "mail -s subject noy@ayala.com.ph < my_message".
I'd really like to remove sendmail from my system.
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	Which article?  I'm trying to submit at least
	one a month.
<P>
	Well, you can use smail or qmail.  These are
	replacements for sendmail.  
<P>
	I haven't installed either of these but I've 
	fetched a copy of qmail and read a bit of the 
	documentation.  I might be implementing a 
	system with that pretty soon.
<P>
	However I'm not sure how much you gain this
	way.  It's possible to configure 'sendmail'
	to send only so that it doesn't listen to 
	incoming mail at all.  This is most easily
	done by simply changing the line in your 
	rc files that invokes sendmail (that would be
	/etc/rc.d/init.d/sendmail.init on a typical
	Red Hat or Caldera system).  Just take the 
	"-bd" off of that line like so:
<PRE> 
		/usr/lib/sendmail -bd -q1h
</PRE> 
	... would become:
<PRE> 
		/usr/lib/sendmail -q1h
</PRE> 
	... or
<PRE> 
		/usr/lib/sendmail -q15m
</PRE> 
		(changing the queue processing frequency 
		from every hour to every 15 minutes).
<P>
	You can also remove sendmail from memory entirely
	and use a cronjob to invoke it like:
<PRE> 
	00,30 * * * * root /usr/lib/sendmail -q
</PRE> 
		(to process the queue on the hour and at
		 half past every hour).
<P>
	If you concerns are about remote attacks through 
	your smtpd service than any of these methods will
	be sufficient.  
<P>
	You should also double check your /etc/inetd.conf for 
	the smtp service line.  This is normally commented out 
	since most hosts default to loading a sendmail daemon.  
	It should stay that way.
<P>
	If you are using fetchmail (and getting your 
	mail via POP or IMAP) you either after to load
	some sort of smtp listener (such as sendmail,
	smail, or qmail) or you have to over-ride 
	fetchmail's defaults with some command line
	options.
<P>
	'fetchmail' defaults to a mode whereby it 
	connects to the remote POP or IMAP server,
	and to the localhost's smtpd and relays the 
	mail from one through the other.  This allows
	for any aliases, .forwards, and procmail processing
	to work properly on the local system and it 
	allows fetchmail to benefit from sendmail's 
	queue handling (to make sure you have sufficient
	disk space etc).
<P>
	However you can configure sendmail to run out 
	of in inetd.conf with TCP Wrappers (the tcpd entry that 
	appears on almost all of the other services in that file) 
	and limit the listener to only accept connections from 
	the local host.
<P>
	You'd then configure your /etc/hosts.deny file
	to look something like:
<PRE>
		ALL:ALL
</PRE> 
	... spr  (default to not letting anyone access any
	local services) -- and you'd put something like:
<PRE> 
		ALL: localhost
		in.telnetd: LOCAL
		in.ftpd: LOCAL
</PRE> 		
	... etc. in your /etc/hosts.allow
<P>
	Finally you'd add something like:
<PRE> 
smtp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/sendmail -bs 
</PRE> 
	... to your /etc/inetd.conf.  
<P>
	(the -bs switch tells sendmail to "be" an "smtp"
	 handler for one transaction.  It handles one 
	 connection on stdin/stdout and exits).
<P>
	 All of this discussion assumes that you want to
	 be able to use local mailers (like elm, and mailx)
	 to send your mail and fetchmail to fetch it 
	 from a POP or IMAP server.
<P>
	If your client is capable of it (like the 
	mail reader in Netscape) you could configure
	it to use a remote smtpd gateway directly
	(it would make the connection to the remote
	host's smtp port and let it relay the mail from
	there).  Then you'd have no sendmail, qmail, or
	smail anywhere on the system.
<P>
	pine might be able to send directly via smtp
	(it does have an IMAP client so this would be a
	logical complement to that).
<P>
	I hope all of this discussion gives you some ideas.
	As you can see there are lots of options.
<P>
-- Jim 

<p><hr><p> 
<!--================================================================-->

<a name="mount"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Mounted vfat filesystems 
</h3>
<P> <B> 
From: Steve Baker, <A HREF="mailto:ssbaker@mwr.is">ssbaker@mwr.is </A> 
</B> <P><B>  
I have 2 vfat filesystems mounted. They belong to root; is there any way
to give normal users read/write access to these filesystems? chown has
no effect on vfat directories and files.
</B> <PRE><B>  
man 8 mount
</B> </PRE> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	I think this answer was a waste of bandwidth.
	Perhaps Andries didn't know this -- or perhaps he
	tried and the man page didn't make any sense.
<P>
	In either event it doesn't do a thing for any of us 
	(that didn't know the answer) and is an obvious and
	public slap in the face.
<P>
	You could have at least added:
<P>
		'look for gid= and umask= under options'
<P>
	Me, I don't know these well enough so let me 
	switch over to another VC, pull up the man page myself,
	and play with that a bit...
<PRE> 	
	mount -t msdos -ogid=10,umask=007 /dev/hda1  /mnt/c
</PRE> 
	This command mounts a file system of type msdos (-t)
	with options (-o) that specify that all files are to 
	be treated as being owned by gid 10 ('wheel' on my system)
	and that they should be have an effective umask of 007
	(allowing members of group 'wheel' to read, write and 
	execute anywhere on the partition.  My C: drive is 
	/dev/hda1 and I usually mount it under /mnt/c.
<P>
	I tried specifying the gid by name -- no go.  You have to 
	look up the numeric in the /etc/group file.  I tried
	different ownership and permissions on the underlying 
	directory -- they are ignored.
<P>
	This set of parameters does seem to work with vfat and
	umsdos mountings.  Using the msdos or vfat at the time
	means that chmod and chown/chgrp commands dont' work
	on that fs.  Using the -t umsdos allow me to change the 
	ownership and permissions -- and the changes seem to be
	effective.  However there are some oddities in what happens
	when you umount and remount the drive (the move of the 
	write permission on files seems to stick but the ownership
	changes are lost and the owner/group r-x bits seem to 
	"come back."
<P>
	Obviously I haven't done much testing with this sort of 
	thing.  I usually don't write to my DOS partitions 
	from in Linux.  In fact I haven't see my DOS hard drive
	partition on this system in months (ever since I started
	compiling the msdos, vfat, and umsdos filesystems as 
	modules -- so I don't  automount them).
<P>
	I hope that helps.
<P>
	Personally I wish that the mount command would take some
	hints from the permissions of the directory that I'm 
	mounting onto.  I'm copying you two on this in the hopes
	that you'll share your thoughts on this idea.
<P>
	What if the default for mount was to set the gid and umask
	of an msdos/vfat directory based on the ownership and 
	permissions of the mount point.  In other words I set up
	/mnt/c to look like:
<PRE> 
drwxrwx---   2 root     wheel        1024 Aug  5  1996 c
</PRE> 
	(which I have) and mount would look up the gid for 
	wheel and use that and the umask for the mount options.
<P>
	This strikes me as being a reasonably intuitive behaviour.
<P>
	If it can't be the default how about an option like:
<PRE> 
		-o usemountperms
</PRE> 
	... (that particular example seems a little ugly -- but
	fairly self-explanatory).
<P>
-- Jim
 

<p><hr><p> 
<!--================================================================-->

<a name="pop"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Re: Answer Guy - POP3 Email 
</h3>
<B> 
From: Brent Austin, <A HREF="mailto:baustin@iamerica.net">
baustin@iamerica.net </A> 
</B> <P><B>  
In reading your answer in LG#14 on "Dealing with e-mail on a pop3 server",
I have almost the same challenge.  I have an ISP that is providing a 25
user POP3 Virtual Mail Server for 25 users.  The problem is that each user
must connect with the ISP individually and then to the mail server.
I would like to find some method to allow Linux to connect with the Mail
Server, individually poll each users account, and then transfer it into a
POP3 server
on the local network (possibly on the Linux box itself).  Any suggestions??
</B>
<P>
<img align=bottom alt=" " src="../gx/ans2.gif">
	If I understand you correctly you have a LAN at your 
	place with about 25 users/accounts on it.
	You're provider has set up 25 separate POP3 mailboxes.
<P> 
	You'd like to set up your Linux (or other Unix) box to
	fetch the contents of all of these accounts (perhaps via
	a cron job) and to have it process your outgoing mail queue.
<P> 
	Then your users would fetch their mail from the Linux
	box (using their own Linux user agents or perhaps using
	Pegasus or Eudora under Windows or from Macs.
<P> 
	This is relatively straightforward (especially the POP3 
	part).
<P> 
	First get a copy of 'fetchmail' (I'm using 2.5 from 
	ftp://sunsite.unc.edu).  Build that.
<P> 
	Now, for each user, configure fetchmail using a 
	.fetchmailrc file in their home directory
<P> 
	Each will have a line that looks like:
<PRE> 
poll $HOST.YOURISP.COM proto pop3 user $HISACCT password $HISPASS
</PRE> 
	The parts of the form $ALLCAPS you replace with 
	the name of the pop server, the account holder's name
	and the account holder's password.  (I presume that  you,
	as the admin for this Unix box, are already entrusted
	with the passwords for these e-mail accounts -- since
	the admin of any Unix box can read any of the mail flowing
	through it anyway).
<P> 
	Now set up a script run as root that does something like:
<PRE> 

	##! do mail psuedo-code
	pppup (some script that brings up your PPP link)
	for users in $USERLIST do;
		[ -e ~$user/.fetchmailrc] && \
			su -c $user /usr/local/bin/fetchmail
		done;
	/usr/lib/sendmail -q		
	pppdown
</PRE> 
	You can add a section of code that graps the list
	of users from your /etc/group file (if you're writing 
	this in perl use the getgrent function (to get group
	entries) or you can use something like:
<PRE> 
	
	awk -F":" '/'$GROUPNAME\
		'/ {split($4,users, ","); 
		for (a in users) {print users[a]}; exit}' /etc/group
</PRE> 
	To get the list of users in a form suitable for 
	use in your 'for' loop.
<P> 
	Naturally my psuedo-code is closer to bash' syntax.
<P> 
	This script  (the psuedo-code one) will just bring the 
	ppplink up, for each user in the list (perhaps from a 
	group named "popusers") it will check for a .fetchmailrc
	file in their home directory and run fetchmail for those
	that have one.  It will then call sendmail to process your
	outgoing queue and bring the ppplink down.
<P> 
		(Note: the su -c ... part of this is not
		secure and there are probably some exploits
		that could be perpetrated by anyone with 
		write access to any of those .fetchmailrc's.
		However it's probably reasonably robust
		-- and you could set these files to be 
		immutable (chattr +i) and you can write
		a more secure SUID perl script to actually
		execute fetchmail.  My scripts, pppup and 
		pppdown are SUID perl scripts.
<P> 
	I haven't written this as real code and tested it since
	I don't have a need of it myself.  I recommend that 
	disconnected networks avoid using POP/SMTP for their 
	mail feed.  UUCP has been solving the  problems of 
	dialup mail delivery for 25 years and doesn't involve some 
	of the overhead and kludges necessary to do SMTP for 
	intermittently connected systems.
<P> 
	I do recommend POP/SMTP within the organization and 
	and it's absolutely necessary for the providers.
<P> 
	Anyway -- fetchmail will then have put each user's
	mail into his or here local spool file (and processed
	it through any procmail scripts that they might have 
	set up).
<P> 
	Now each of your users can use any method they prefer
	(or that you dictate) to access their mail.  DOS/Windows
	and Mac users can use Pegasus or Eudora, Linux or other
	Unix users can use fetchmail (or any of several other
	popclient, getpop, etc, other programs) to get the
	messages delivered to their workstation, or anyone in
	the organization can use telnet into the mailhost and
	user elm, pine, the old UCB mail, the RAND MH system
	or whatever.
<P> 
	All of these clients point their POP and mail clients
	to your mailhost.  Your host then acts as their spool.
	This is likely to result in fewer calls to your ISP and
	more efficient mail handling all around.
<P> 
	You may want to ask your ISP -- or look around -- for 
	UUCP providers.  On of the big benefits to this is that
	you gain complete control of mail addressing within your
	domain.  Typical UUCP rates go for about $50/mo for a 
	low volume account and about $100/mo for anything over
	100Mb per month.  However it's still possible to find
	bargains.
<P> 
	(Another nice thing about UUCP is that you can choose
	specific sites, with which you exchange a lot of mail,
	and configure your mail to be exchanged directly with
	them -- if they have the technical know-how at their
	end or are willing to let you do it for them.  This 
	can be done via direct dialup or over TCP connections).
<P> 
	uu.net is the Cadillac of UUCP providers (which is 
	a bit pricey for me -- I use a small local provider
	who gives me a suite of UUCP, PPP, shell, virtual hosting,
	virtual ftp, and other services -- and is of little
	interest to you unless you're in the Bay Area).
<P> 
	You can also find information on Yahoo! using
	a search for "uucp providers" (duh!).  I also 
	seem to recall that win.net used to provide 
	reasonable UUCP (and other) services.
<P> 
	Hope this helps.  If you need more specific help in 
	writing these scripts you may want to consider paying
	a consultant.  It should be less than three hours work
	for anyone whose qualified to do it (and not including
	the configuration of all your local clients).
<P> 
-- Jim

<p><hr><p> 
<!--================================================================-->

<a name="pseudo"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Pseudo Terminal Device Questions
</h3>
From: Jeong Sung Won
<P> <B> 
Hello ?<BR> 
My name is Jeong Sung Won. May I ask you a question ?
I'll make a program that uses PSEUDO TERMINAL DEVICE.
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	No need to shout -- I've heard of them.  They're
	commonly called pty's -- used by 'telnetd', 'expect', 
	'typescript', and emacs' 'M-x shell' command -- among 
	others.
<P><B>  
<img align=bottom alt=" " src="../gx/ques.gif">
But linux has 8 bit MINOR NUMBER, so that total number of
pseudo terminal device DOESN'T OVERCOME 256.
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	That does seem to be true -- but it is a rather
	obscure detail about he kernel's internals.
<P> 
	Linus' work on the 64-bit Alpha port may change
	this.
<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
Is there any possible way to OVERCOME THIS LIMITS ?
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	Only two that I can think of.  Both would 
	involve patching the kernel.
<P> 
	You might be able to instantiate multiple
	major devices -- which implement that same
	semantics as major device number 4 (the 
	current driver for the virtual consoles and 
	all of the pty's).
<P> 
	I'm frankly not enough of a kernel hacker to tell 
	you how to do this or what sorts of problems it would
	raise.
<P> 
	The other would involve a major overhaul of the
	kernel code and all the code that depends on it.
<P><B>  
<img align=bottom alt=" " src="../gx/ques.gif">
For example,on HP9000, minor number is 24 bit, 
and actually I used concurrently 800
pseudo terminal device. And more than 1000 is also possible.
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	I wonder what it is on RS/6000, DEC OSF/1, and Sun/Solaris.
<P> <B> 
<img align=bottom alt=" " src="../gx/ques.gif">
On Linux, is it impossible to make it, let me know the way I counld tell
LINUS that upgrade minor number scheme from 8-bit to 16-bit or more-bit 
is needed.
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	Linus Torvald's e-mail address has been included with
	every copy of the sources ever distributed.  
<P> 
	However it is much better to post a message to the 
	comp.os.linux.development.system newsgroup than 
	directly to him (or any of other developer).
<P> 
	As for "telling LINUS [to] upgrade" -- while it would 
	probably be reasonably well recieved as a suggestion --
	I'm not sure that "telling" him what to do is appropriate.
<P> 
	It's easy to forget that Linus has done all of his work
	on the Linux kernel for free.  I'm not sure but I 
	imagine that the work he puts in just dealing with all the
	people involved with Linux is more time consuming and
	difficult than the actual coding.
<P> 
	As many of the people who are active in the Linux community
	are aware Linus has been very busy recently.  He's accepted
	a position with a small startup and will be moving
	to the San Francisco Bay Area (Silicon Valley, actually) 
	-- and he and Tove have just had a baby girl.  
<P> 
	I will personally understand if these events keep him 
	from being as active with Linux as he as been for the
	last few years.
<P> 
-- Jim

<p><hr><p> 
<!--================================================================-->

<a name="root"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
root login Bug in Linux
</h3>
<P> <B> 
From: Shevek, <A HREF="mailto:ma6ybm@bath.ac.uk">ma6ybm@bath.ac.uk </A> 
</B> <P><B>  
Has anybody else found a root login bug evident on my system.
</B> <P><B>  
The root password is an 8 character random series. For going live online 
I updated the root password to a 16 character random series. I can log in 
with the 16 character series, but also using the first eight and any 
random characters after that, or just the first eight. This creates an 
infinite number of root passwords and worries me more than a little.
</B> <P> 
About Unix Passwords and Security
<P>
	This is a documented and well known limitation of 
	conventional Unix login and authentication.
<P>
	You can overcome this limit if you upgrade to the 
	shadow password suite (replace all authenticating
	programs with the corresponding shadow equivalents)
	and enable the MD5 option (as opposed to the traditional
	DES hash).
<P>
	Note -- there is probably an "infinite" number of valid
	passwords to either of these schemes.  The password
	entry on your system is not encrypted.  That is a 
	common misconception.  What is stored on your system
	is a "hash" (a complex sort of checksum).  
<P>
	Specifically the traditional Unix DES hash uses your password as
	the key to encrypt a string of nulls.  DES is a one-way algorithm
	-- so there is no known *efficient* way to reclaim the key even
	if one has copies of the plaintext and the ciphertext.
<P>
	'Crack' and it's brethren find passwords by trying dictionaries
	of words and common word variations (reverse, replace certain
	letters with visually similar numerics, various abbreviations,
	prepending/appending one or two digits, etc) -- and using the
	crypt() function (or an equivalent) on a string of nul's to find
	matches.  This isn't particularly "efficient" -- but it is several
	orders of magnitude better than an exhaustive brute force attack.
<P>
	The only two defenses against 'Crack' are:  
<ol>
<li>		Don't let anyone have copies of the password hashes
		(which is why the shadow suite puts those in a separate
		file -- that is only readable by SUID or SGID programs,
		and not normal users)
<li>		Don't allow users to use words, names, or simple
		variations of words as their passwords.  This is don't
		by installing npasswd or passwd+ (replacements for the
		stock passwd program).
</ol>
	Use both of these strategies on all mult-user systems.
	That way, if someone exploits some newly discovered 
	bug to get a copy of the shadow file, he is less likely
	to get any good passwords (since that will entail a
	password that is more clever than your npasswd rules and
	less clever than your attackers custom 'crack' dictionaries).
<P>
	It is possible that two different passwords (keys) will
	result in the same hashed value (I don't know if there are
	any examples with DES 56 bit within the domain of all
	ASCII sequence  up to eight characters -- but it is possible).
<P>
	Using MD5 allows you to have passwords as long as you like.
	Again -- it is possible (quite likely, in fact) that a
	number of different inputs will hash to the same value.
	Probably you would be looking at strings of incomprehensible
	ASCII that were several thousand bytes long before you found
	any collisions.  
<P>
	Considering that the best supercomputers and parallel
	computer clusters that are even suspected to exist take
	days or weeks to exhaustively brute force a single DES
	hash (with a max of only 8 characters and only a 56-bit
	key) -- it is unlikely that anyone will manage to find 
	one of the "other" valid keys for any well chosen password
	without expending far more energy and computing time than
	most of our systems are worth.  (Even in these days of 
	cheap PC's -- computer time is a commodity with a 
	pricetag).
<P>
	There other ways to get long password support on your 
	system.  However the only reasonable one is to use the shadow
	suite compiled with the MD5 option.  This is the way that
	FreeBSD (and it's derivatives) are installed by default --
	so the code and systems have been reasonably well tested.
<P>
	In fact -- if security and robustness are more important
	to you than other features you may want to consider
	FreeBSD or (or NetBSD, or OpenBSD) as an alternative.
	These are freely distributed Unix implementations which 
	have been around as long as Linux.  Obviously they have a 
	much smaller user base.  However each has a tightly knit
	group of developers and a devoted following which provides
	or an extremely robust and well-tested system.
<P>
	As much as I like Linux -- I often recommend FreeBSD for
	dedicated web and ftp servers.  Linux is better suited to
	the desktop and to use with exotic hardware -- or in 
	situations where the machine needs to interact with
	Netware, NT and other types of systems.  
		[Oh, Oh!  Here come the fireballs!]
<P>
	FreeBSD has a much more conservative set of features 
	(no gpm support for one example -- IP packet filtering 
	is a separate package in FreeBSD while it's built into 
	the Linux kernel).
<P>
	Another consideration is the local expertise.
	Linux and FreeBSD are both extremely similar in most
	respects (as they both are to most other Unix 
	implementations).  In some ways they are more similar
	to one another than either is to any non-PC Unix.
	However the little administrative difference might 
	very well drive your sysadmin crazy.  Particularly if 
	he has a bunch of Linux machines and is used to them --
	and you specify one or two FreeBSD systems for 
	your "DMZ" (Internet exposed LAN segment).
<P>
	Back to your original question:
<P>
	You said that you are using a "random" string of characters
	for your password.  In terms of cryptography and security
	you should be quite careful of that word: "random"
<P>
	Several cryptographically strong systems have been 
	compromised over the years by attacking the randomizer
	that were used to generate keys.  A perfect example of
	this is the hack of SSL by a student in France (which 
	was published last spring).   He cracked a Netscape
	challenge and got a prize from them for the work
	(and Netscape implemented a better random seed generation
	algorithm).
<P>
	In the context of creating "strong" passwords (ones
	that won't be tested by the best crack dictionaries out
	there) you don't need to go completely overboard.  
	However -- if a specific attacker knows a little bit
	about how you generate your random keys -- he or she
	can generate a special dictionary tailored for that 
	method.
<P><B>  
<img align=bottom alt=" " src="../gx/ques.gif">
Kernel linux 2.0.20
System P90, 8Mb, IDE, SCSI (not working fully), cd, sound, etc.
root hda2, about 20 user entries in passwd.
</B> <P><B>  
Next bug:
Two users with consecutive login entries. Both simply information logins, 
never to be logged in to, just for fingering to for status information. 
If you finger the second, OK. But if you finger the first, it fingers 
both. UID numbers 25 and 26. If I comment 26, but have a third login on 
UID 27 then it is OK. I have tried unassigning the groups and reassigning 
them. They both have real home directories, shell is dev/null, and are in 
a group called 'private' on their own. There are no groups by the same 
name as the login.
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	This sounds very odd.  I would want to look at the 
	exact passwd entries (less the password hashes) and to 
	know alot about the specific implementation of 'finger'
	that you were using (is it the GNU cfingerd?).
<P>
	I would suggest that you look at the GNU cfingerd.
	I think it's possible to configure it to do respond
	to "virtual" finger requests (i.e. you can configure
	cfingerd to respond to specific finger requests by 
	return specific files and program outputs without
	having any such accounts on your system).  This is 
	probably safer and easier than having a couple of 
	non-user psuedo accounts and using the traditional
	finger daemon.  (In additional the older fingerd is
	notoriously insecure and overflows of it was one 
	of the exploits used by the "Morris Internet Worm" 
	almost a decade ago).
<P>
	Given the concerns I would seriously consider 
	running a finger daemon in a chroot'd jail.
	Personally I disable this and most other services
	in the /etc/inetd.conf when ever I set up a new system.
<P>
	When I perform RASA (risk assessment and security auditing)
	/etc/inetd.conf is the second file I look at (after looking
	for a /etc/README file -- which no one but me ever keeps; and
	inspecting the /etc/passwd file).
<P>
-- Jim


<p><hr><p> 
<!--================================================================-->

<a name="again"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Sendmail-8.8.4 and Linux
</h3>
<P> <B> 
From: Brent Austin, <A
HREF="mailto:baustin@iAmerica.net">baustin@iAmerica.net </A>
</B> <P><B>  
After setting up fetchmail and the PPP link to my ISP, everything has worked
perfectly retrieving mail from the POP3 account.
</B> <P><B>  
Now, I've stumbled on another problem I require some help with.  Compiling
and Installing Sendmail-8.8.4 (or 8.8.5).  I downloaded the 8.8.4 source
from sunsite and set it up in the /usr/src directory and using the O'Reilly
"Sendmail" book as my guide, I modified the Makefile.Linux for no DNS
support by setting ENVDEF = -DNAMED_BIND=0. And removing Berkeley DB support
(removing -DNEWDB).
After compiling and executing ./sendmail -d0.1 -bt < /dev/null in the obj
dir, I receive the following:
</B> <PRE><B>  
Version 8.8.4
 Compiled with: LOG MATCHGECOS MIME7TO8 MIME8TO7 NDBM NETINET NETUNIX
		QUEUE SCANF SMTP XDEBUG
</B> </PRE> <B> 
and the program hangs at this point.
I am running Linux.2.0.29 on a 486DX40 with 8 megs.  My gcc is version 2.7.0.
</B> <P><B>  
Any hints you could provide are greatly appreciated!,
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	I fetched a copy of 8.8.5 and used the .../src/makesendmail
	script -- and only encountered the problems with NEWDB
	Removing that seemed to work just fine.
<P>
	I noticed you said -- .../src/obj -- did you mean something
	like: .../src/obj/obj.Linux.2.0.27.i386/
<P>
	If you properly used the makesendmail script then the
	resulting .o and binaries should have landed in a directory
	such as that.
<P>
	Other than that I don't know.
<P>
	I don't disable the DNS stuff -- despite the fact that
	my sendmail almost all done via uucp.  
<P>
	As for using this with fetchmail -- I have my sendmail
	configured in /etc/inetd.conf like so:
<PRE> 
# do not uncomment smtp unless you *really* know what you are doing.
# smtp is handled by the sendmail daemon now, not smtpd.  It does NOT
# run from here, it is started at boot time from /etc/rc.d/rc#.d.
## jtd:  But I *really do* know what I'm doing.
## jtd: I want fetchmail to handle mail transparently and I
## jtd want tcpd to enforce the local only restriction
smtp    stream  tcp     nowait  root    /usr/sbin/tcpd  /usr/local\
		/sbin/sendmail -bs
</PRE> 
	(note -- the line back is for this mail only -- remove it
	before attempting to use this line.  Also note the -bs
	"be an smtp handler on stdin/stdout")
<P>
	This arrangement allows me to fetchmail, lets fetchmail
	transparently talk to sendmail, and keeps the rest of the
	world from testing their latest remote sendmail exploit
	on me while my ppp link is up (I wouldn't recommend this
	for high volume mail server!).
<P>
	Naturally I also have a cron job like this:
<PRE> 
## Call sendmail -q every half hour
00,30 * * * * root /usr/lib/sendmail -q
</PRE> 
	(which processes any mail that elm, pine, mh-e
	or any other mailers have left in the local queue --
	awaiting their trip through uucp's rmail out to the
	rest of the world).
<P>
	If you continue to have trouble compiling sendmail
	then you may want to just rely on the RPM updates.
	Compiling it can be tricky, so I avoid doing it 
	unless I see a bugtraq or CERT advisory with the
	phrase "remotely exploitable" in it.
<P>
	Re: O'Reilly's "bat" book.  Do you have the 2nd Edition?
	If not -- get it (and ask them about their "upgrade"
	pricing/discount if that's still available)
<P>
-- Jim
<p><hr><p> 
<!--================================================================-->

<a name="wuftpd"></a>
<h3> <img align=bottom alt=" " src="../gx/ques.gif">
wu-ftpd Problems
</h3>
<P> <B> 
From: Ed Stone, <A HREF="mailto:estone@synernet.com">estone@synernet.com </A>
</B> <P><B>  
On BSDI, I've read ALL of the doc for wu-ftpd, and have ftp logins
limited to the chroot dir, but still have these problems:
1) I cannot force ftp only. The guestgroup "guests" can telnet, and go
everywhere. I've put /bin/true in /etc/shells; I've edited passwd and
master.passwd for that; no effect
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	Usually I set their passwd to /bin/false or /usr/bin/passwd.
	I make sure that I use the path filter alias to prevent
	uploads of .rhosts and .forward files into their 
	home directory under the chroot and I put entries like:
<PRE> 
		/home/.ftp/./home/fred
</PRE> 
	... for their home directory field in the (true-root)/etc/passwd
	file.
<P>
	Also make sure that you have the -a switch on the ftpd 
	(or in.ftpd) line in your inetd.conf.  The -a tells ftpd to
	use the /etc/ftpaccess file (or /usr/local/etc/ftpaccess --
	depending on how you compiled it).
<P>
	Personally I also configure each "ftponly" account into
	the sendmail aliases file -- to insure that mail gets
	properly bounced.  I either set it to the user's "real"
	e-mail address (anywhere *off* of that machine) or I set it
	to point at nobody's procmail script (which autoresponds to
	it).
<P> <B> 
<img align=bottom alt=" " src="../gx/ques.gif">
2) "guests" ftp to the proper directory, but get no listing. I have set
up executable of ls in the ftp chroot dir in /bin there; no effect.
</B> <P> 
<img align=bottom alt=" " src="../gx/ans2.gif">
	How do you know that they are in the proper directory?
	What happens if you use a chroot (8) command to go to 
	that dir and try it?  Is this 'ls' statically linked?
	Do you have a /dev/zero set up under your (chroot)/?
<P>
	Most common cause of this situation is a incomplete 
	(chroot) environment -- usually missing libraries or 
	missing device nodes.
<P>
-- Jim
<P>

<!--================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, James T. Dennis <BR> 
Published in Issue 15 of the Linux Gazette March 1997</H5></center>

<P> <hr> <P> 
<!--================================================================-->
<A HREF="./lg_toc15.html"><IMG SRC="../gx/indexnew.gif" ALT="[ TABLE OF 
CONTENTS ]"></A> <A HREF="../index.html"><IMG SRC="../gx/homenew.gif" 
ALT="[ FRONT PAGE ]"></A> 
<A HREF="lg_bytes15.html"><IMG SRC="../gx/back2.gif" ALT=" Back "></A>
<A HREF="./clueless.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
</body> 
</html>