The great AT Linux/BSD/*NIX FAQ project!

Page 9 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

MetroFly

Member
Sep 14, 2002
29
0
0
i have a request:

1) just installed freeBSD. i used dchp to configure my networking. this always works in linux, and my internet does work in bsd, but i always get a "bad display name-XXXXX"

xxx = my host name. It doesn't cause any trouble, its just annoying.

2a) about WM. how do i uninstall kde or gnome *completely*. meaning all those dependency files as well. i asked around, and the only reponse i gots was to pkg_delete gnome or kde, but that doesn't delete all those other files associated with it.

2b) more about WM:

how do i edit my .xinitrc file to load the wm of my choice.
i did the "exec wmhere" but that didn't work.

any help appreciated. thanks.

edit: grammar
 

TheOmegaCode

Platinum Member
Aug 7, 2001
2,954
1
0
1) just installed freeBSD. i used dchp to configure my networking. this always works in linux, and my internet does work in bsd, but i always get a "bad display name-XXXXX"

xxx = my host name. It doesn't cause any trouble, its just annoying.
Change your hostname /etc/hosts

2a) about WM. how do i uninstall kde or gnome *completely*. meaning all those dependency files as well. i asked around, and the only reponse i gots was to pkg_delete gnome or kde, but that doesn't delete all those other files associated with it.
AFAIK, pkg_remove won't uninstall dependencies, unless you use -F which isn't smart. I really try to stay away from packages when I use FreeBSD and use the ports (yes, I know packages are essentially precompiled ports, but I prefer make deinstall to pkg_delete).

2b) more about WM:

how do i edit my .xinitrc file to load the wm of my choice.
i did the "exec wmhere" but that didn't work.
It's been a while since I've used it, but I think windowmaker needs "exec wmaker."

And bump for the thread that needs re-sticking...
 

IcemanJer

Diamond Member
Mar 9, 2001
4,307
0
0
up again.

you know, there should be a FAQ about how to install Linux on nForce motherboards.
as a newbie, it took me a few weeks searching (well, not very actively) before I hit the right information about how to (and the reason to) boot into runlevel 3, how to unpack and RPM the Red Hat packages from nVidia, how to configure XWindow, and stuff like that. And something I just figured out today, that by default Linux has 7 virtual terminals that you can switch around by pressing Ctrl + Alt + F1 thru F7. And if you have X started, then that session gets tacked onto session 7, so pressing Ctrl + Alt + F7 gets you back to the GUI if you've switched out.

yeah i know, nothing very exciting, but heck I was exciting to find out that I could do that.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: MetroFly
i have a request:

1) just installed freeBSD. i used dchp to configure my networking. this always works in linux, and my internet does work in bsd, but i always get a "bad display name-XXXXX"

When do you get this error?

xxx = my host name. It doesn't cause any trouble, its just annoying.

2a) about WM. how do i uninstall kde or gnome *completely*. meaning all those dependency files as well. i asked around, and the only reponse i gots was to pkg_delete gnome or kde, but that doesn't delete all those other files associated with it.

cd /usr/ports/x11/kde2&&more Makefile

There is probably a list of dependancies in there (there is on OpenBSD), but check to make sure you are going into the right KDE directory, I believe on OpenBSD there is a kde and a kde2.

2b) more about WM:

how do i edit my .xinitrc file to load the wm of my choice.
i did the "exec wmhere" but that didn't work.

any help appreciated. thanks.

edit: grammar

Check the documentation of the specific wm you want to load.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: IcemanJer
up again.

you know, there should be a FAQ about how to install Linux on nForce motherboards.
as a newbie, it took me a few weeks searching (well, not very actively) before I hit the right information about how to (and the reason to) boot into runlevel 3, how to unpack and RPM the Red Hat packages from nVidia, how to configure XWindow, and stuff like that. And something I just figured out today, that by default Linux has 7 virtual terminals that you can switch around by pressing Ctrl + Alt + F1 thru F7. And if you have X started, then that session gets tacked onto session 7, so pressing Ctrl + Alt + F7 gets you back to the GUI if you've switched out.

yeah i know, nothing very exciting, but heck I was exciting to find out that I could do that.

Send me an nForce based machine and Ill write it. Im not writing that one blind )
 

agnitrate

Diamond Member
Jul 2, 2001
3,761
1
0
Originally posted by: n0cmonkey
Originally posted by: IcemanJer
yeah i know, nothing very exciting, but heck I was exciting to find out that I could do that.

Send me an nForce based machine and Ill write it. Im not writing that one blind )

Uhh, yeah, I COULD do that faq for you but I will also be needing an nforce board. Oh yeah, be sure to ship it with a XP 1900 or greater so I can test the uhhh...compatibility. Yeah, that's the ticket

Bumpity bump again.

-silver

 

IcemanJer

Diamond Member
Mar 9, 2001
4,307
0
0
Originally posted by: n0cmonkey
Send me an nForce based machine and Ill write it. Im not writing that one blind
Actually I can probably do it. I'm in the process of setting RedHat 8 on my nForce. Well, I'll get around to it as soon as my midterms are over.... $@#&...
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: IcemanJer
Originally posted by: n0cmonkey
Send me an nForce based machine and Ill write it. Im not writing that one blind
Actually I can probably do it. I'm in the process of setting RedHat 8 on my nForce. Well, I'll get around to it as soon as my midterms are over.... $@#&...

I have plenty of time right now, just no nForce machine or money for one...

Please do write one up, Id be interrested to see it. I thought about an nForce mobo, but really dont feel like messing with all the prooprietary stuff.
 

IcemanJer

Diamond Member
Mar 9, 2001
4,307
0
0
Lemme see if I have time next week to do it.
When I do, do I just post it here or something?
Maybe it would be a good thing to have over in the FAQ as well.
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81
Alright, the loopback device FAQ is now considered "1.0". If you see a glaring error, PM me.Mounting ISO files, encrypting hard drives, and other applications of the Linux Loopback Device

One of the most useful features of Linux is the Loopback device. This is a function of the Linux kernel that lets you do things like mount ISO files without burning it to a CD,
create an encrypted filesystem, hide a filesystem with steganography, create initialization RAM disks for boot CDs and floppies, and much, much more. This FAQ will tell you
how to use it.

There are two ways to create a loopback device. The simplest is using mount with the -o loop switch, and more complex things can be done with losetup.
The former just lets you mount a filesystem that resides within a normal file, such as an ISO, whereas the latter lets you do things like encryption.

In this FAQ, I will tell you how to do three things using the loopback device:
1. Mount an ISO file without burning it to a CD
2. Create a simple filesystem within a file
3. Create a simple encrypted hard drive partition

First, however, you need to have loopback support in the kernel. The kernels included in almost every distro out there either have support built in, or available as a module. If
you get errors when trying the commands below, try running modprobe loop as root. If that produces an error, you will most likely need to compile a new kernel. Whilst
going through the configuration options, ensure that you enable "Loopback Device Support" in the Block Devices section.

Another thing you might want to recompile your kernel for is to apply the crypto patch. In addition to other things, this allows you to use far stronger encryption methods on
the loopback device. If I understand correctly, the best you can do without it is XOR encryption, which is easier to crack than an egg. I will elaborate on this at the end of the
FAQ.

Now, with that out of the way, on to the application examples.


Mounting an ISO without buring it to a CD

This is, by far, the thing I miss most when I am forced to use windows. With a single command, you can mount an ISO file directly off of the hard drive, as if it were a CD.
The command to do this is:

mount -o loop -t iso9660 filename /mnt/cdrom

Explanation:

mount: Involks the mount command.
-o loop: Specifies that the option "loop" be passed to mount. This tells it to attach the specified file to a loopback device, and the mount that automaticly.
-t iso9660: Specifies that the ISO-9660 filesystem is being used. mount can detect this by itself, but I always specify it anyway.
filename: This tells mount what file to mount.
/mnt/cdrom: The mount point that will be used. This can be any directory. /mnt/cdrom and /cdrom are considered the standard places to mount CDs, so that's what I
use.

When you are done with it, unmount it using this command:

umount -d /mnt/cdrom

Explanation:

umount: Involks the umount command.
-d: Tells umount to free the loopback device. You can omit this, but the loopback device that was used will remain bound to the file.
/mnt/cdrom: The mount point you used.

Note that this is not limited to ISO files, you can use this procedure for any filesystem embedded in a file, just substitute iso9660 with the correct filesystem. More information
on that in the next example.


Creating a filesystem within a file

There are many reasons why you may want to create a filesystem within a file. Maybe you want seperate filesystems for /home, /usr, /var, and so on without messing
around with setting up partitions. Maybe you want to create a RAM disk for a boot floppy or CD. Maybe you want to test a filesystem utility you're writing. That does not
matter. Regardless of why you're doing it, it is a pretty easy thing to do. Here's the procedure:

1. Create a blank file of the needed size using dd:
dd if=/dev/zero of=filename bs=1M count=size

Explanation:

dd: Runs the dd command.
if=/dev/zero: Tells dd that the data source is /dev/zero, which is a "device" that just spits out zeroes.
of=filename: Tells dd to create a file called filename.
bs=1M: Tells dd to create the file in 1 MB blocks. This can be anything, but using a value like this makes it easier to figure out what to specify for count=.
count=size: Tells dd to copy size blocks, whose size is specified in the bs= parameter.

Example for a 800 megabyte file called loopfile: dd if=/dev/zero of=loopfile bs=1M count=800

2. Create a filesystem in the file. The command varies widely based on what filesystem you use, but most are of the format mkfs_tool_name filename. Here's an
example for Ext3:

mke2fs -j filename

Explanation:

mke2fs: Runs mke2fs, the program that creates ext2 and ext3 filesystems.
-j: Stands for journal. Tells mke2fs to make an ext3 filesystem.
filename: The name of the file you made with dd in step 1.

3. Mount the filesystem. The command for this is exactly the same as the one used to mount an ISO file as explained above, except you replace iso9660 with the type
of filesystem you created in step 2. The same is true for unmounting.


Encrypting a hard drive partition

This is where you can see just how useful the loopback device can be. Using a fairly simple series of commands, you can create an encrypted volume to store your
pr0^H^H^Hfinancial records and other sensitive material. Note that it does not have to be a hard drive partition, you can make a blank file with dd and use that if you want
to, but it seems to me that a seperate hard drive partition is better for this. Anyway, here's how to do it:

1. Make a blank partition if you haven't done so already.
2. Use losetup to bind the partition to a loopback device with encryption. Depending on what kind of crypto you want to use, and any other options you might want to use,
this command varies, but here's an example:

losetup -e xor /dev/loop0 /dev/sda1

Explanation:

losetup: Runs losetup, the program that controls loopback devices.
-e xor: Tells it to use XOR encryption.
/dev/loop0: Tells it what loopback device to use. There are 8 you can use, ranging from loop0 to loop7.
/dev/sda1: Tells it that the data is to be stored on the first partition of the first SCSI hard drive. Replace this with the device or file the data will reside upon.

When you run this, you will be asked for a password.

3. From now on, just use /dev/loop0 where you would normally use /dev/sda1 (or whatever you used), as it works just like a normal hard drive partition.
4. When you are done with it, run losetup -d /dev/loop0 to detatch it. When you need to access it again, just repeat step 2.


Note, however, that XOR encryption isn't very tough. As I said at the beginning of this FAQ, to get stronger encryption methods, such as twofish and aes, you need the
crypto patch for the kernel, and you also need a patched version of losetup from the util-linux package. Here's how to set that up:

1. Download the crypto patch. It is called "patch-int-kernelversion.patchversion.bz2" and can be found at any kernel.org mirror, in the /pub/linux/kernel/people/hvr/testing directory. At the time of writing, the latest one is patch-int-2.4.19.2.bz2.
2. Switch to your kernel source directory. This source must be clean to apply the patch, so run make mrproper. Note that this will delete your .config, so put it somewhere safe, like /usr/src or your home directory.
3. Apply the patch. This command assumes that you downloaded the bzip2 compressed patch, and it is in the directory above the source directory. bzcat ../patch-int-2.4.19-2.bz2 | patch -p1
4. Copy your .config back into the kernel source directory, and then run your favorite kernel configurator.
5. Enable CryptoAPI support, all the message digest algorithims, any ciphers you want (No harm in enabling all of them), and Loop crypto support (under crypto devices).
6. Before you run make dep, you need to apply the cryptoloop patch. It can be found in the same place as the crypto patch, and is named "cryptoloop-version.tar.bz2". Latest as of time of writing is cryptoloop-0.0.1-pre1.tar.bz2. Download and extract it, then enter its directory.
7. Patch the kernel. make patch-kernel KDIR=/kernel/source/directory LOOP=jari
8. Switch back to the kernel directory, and then compile and install it as normal.

You now have a kernel with CryptoAPI. However, as the README indicates, you need a patched losetup utility to take full advantage of it. Here's how to get that:

1. Download the util-linux source code if you don't already have it. It can be found at any kernel.org mirror, in the /pub/linux/utils/util-linux directory. The filename is "util-linux-version.tar.bz2". Latest at time of writing is util-linux-2.11w.tar.bz2. Save it somewhere and unpack it.
2. Download the patch. It too can be found at any kernel.org mirror, in the /pub/linux/kernel/people/hvr/util-linux-patch-int directory. Filename is "util-linux-version.patch.bz2". Get the one whose version is closest to the util-linux package you downloaded.
3. Switch to the util-linux source code directory, and apply the patch. Assuming the patch is in the directory above the util-linux source, the command is: bzcat ../util-linux-2.11r.patch.bz2 | patch -p1
4. Compile it. ./configure && make
5. Install losetup and its man page. cp mount/losetup /sbin/losetup && chown root.root /sbin/losetup && cp mount/losetup.8 /usr/man/man8/losetup.8

Done! Now, read man losetup to learn how to use the new feaures you just added to losetup.

I hope this FAQ has been informative.
-Electrode
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: IcemanJer
Lemme see if I have time next week to do it.
When I do, do I just post it here or something?
Maybe it would be a good thing to have over in the FAQ as well.

Just post it here, AndyHui hooks us up and puts these into the FAQ section of the site every once in a while.
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81
bump, because I have now finished my loopback FAQ, and the thread is at the bottom of page 1
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: AndyHui
Any more?

There will be. Ive been going over a few in my head, but havent had the motivation to write one (unemployment takes its toll ).

Ive been thinking:
snort + mysql
a more in depth permissions paper
something on apache maybe?
OpenSSH

If I get my network back up in the near future a "How to patch the S out of Solaris" how-to/faq may be in order
 

BML

Senior member
Jun 1, 2001
443
0
0
Any word on Nvidia drivers for Redhat 8.0
Ive installed 7.3 with no hitchs but 8.0 dosent seem to like them.

Lets keep this bad boy to the top!
 

Electrode

Diamond Member
May 4, 2001
6,063
2
81
A lot of people seem to be wondering how to use a Linux system to share an internet connection, without using a dedicated router distro like LRP, SmoothWall, ClarkConnect, and the like. Here's how I do it:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all


Then just set up your other systems just like you would if you were using ICS on a windows box.

Don't ask me for help if it doesn't work for you, though, because I barely understand it myself. I just ripped the iptables commands from Mandrake 8.0, and adapted it a bit for my needs. The last command is a simple security measure that I use on my server rig that tells it to ignore pings. It's hard to ping flood a box that just sends them to /dev/null without prejudice.
 

EmperorRob

Senior member
Mar 12, 2001
968
0
0
You also need to add to that:

iptables -A FORWARD -d 192.168.0.0/24 -j ACCEPT

And the client machine will need to set its default gateway to the external IP of the server.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |