# How to prevent the symlink attack (via /etc/fstab)



## MagicCoder (Apr 4, 2010)

How to prevent the symlink attack

What's Symlink Attack ? (Click Here)

To prevent : 
for sample : www and tmp dir

```
[color="YellowGreen"]sh$[/color] cd /
[color="YellowGreen"]sh$[/color] su
[color="YellowGreen"]sh$[/color] umount -a
[color="YellowGreen"]sh$[/color] cat /etc/fstab
.	.	.
.	.	.
.	.	.
/dev/ad4s3	/tmp	ufs	rw	0	0 # tmp dir
/dev/ad4s4	/home	ufs	rw	0	0 # www dir
.	.	.
.	.	.
.	.	. 
[color="YellowGreen"]sh$[/color] ee /etc/fstab
.	.	.
.	.	.
.	.	.
/dev/ad4s3	/tmp	ufs	rw[color="Red"],nosymfollow[/color]	0	0 # tmp dir
/dev/ad4s4	/home	ufs	rw[color="Red"],nosymfollow[/color]	0	0 # www dir
.	.	.
.	.	.
.	.	. 
[color="YellowGreen"]sh$[/color] mount -a
[color="YellowGreen"]sh$[/color] reboot
```

good luck :stud


----------

