Make a Fat32 Partition in Linux

This is handy for transferring files between Windows and Linux, as many distro’s don’t have NTFS RW support built in. This is, of course if you do not have access to the NTFS-3G driver, which does allow for RW mounts.

Overview: fdisk w/ a W95 partition table
mkdosfs

If you need the step by step, it’s below:

fdisk /dev/sd(whatever drive you want to reparition, ‘b’ in this case), then follow along:

The number of cylinders for this disk is set to 20023.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition’s system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n

Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-20023, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-20023, default 20023):
Using default value 20023

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))

Command (m for help): p

Disk /dev/sdb: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000f0136

Device Boot Start End Blocks Id System
/dev/sdb1 1 20023 160834716 c W95 FAT32 (LBA)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

root@sbrescue:/# mkdosfs /dev/sdb1
mkdosfs 3.0.1 (23 Nov 2008)
root@sbrescue:/# mount /dev/sdb1 /mnt
root@sbrescue:/# cd /mnt
root@sbrescue:/mnt# touch asdf
root@sbrescue:/mnt# ls
asdf
root@sbrescue:/mnt#

All done! =D

Hostnames Greater than 15 Characters Effectively Disables MSFTPSvc.

Wait, what?! Oh yeah. It just grinds to a halt, without any helpful error messages. This is just another thing that I want to jot down so I know to check for it the next time I run across a server with FTP issues.

AFAIK, it has to do with a NETBIOS limitation.

How to Connect to the Console Session on Windows

The original title for this post was going to be “I Cannot Believe I Did Not Know This Until Now.” Now it’s a thinly veiled mock up of the source document’s title: How to Connect to and Shadow the Console Session with Windows Server 2003 Terminal Services (2008 features sourced from here). The following feature becomes priceless when two people are logged in remotely and you get that frustrating

"The terminal server has exceeded the maximum number of allowed connections."

Stupid machine, don’t give me an error, then kick off the person who can fix it! Well, until now, I was the stupid admin who didn’t know you could do this:

2003,XP SP1,2: mstsc /v:IPorHostname /console
2008,Vista,XP SP3: mstsc /v:IPorHostname /admin

to log into the physical console session. Sweet!

On a related note, if you want to view a session, you can use

shadow 0

to view that session (0 for physical console in Windows 2003). You will have to be authorized by the user that is logged in however, so no spying by default.

Note: Windows 2008 is better about managing additional log in attempts. If the max number of terminals is reached, the new connection can pick which user they want to log off, and the user about to be logged off has the option to allow, allow by ignoring, or deny the request.

Not that a hard reboot won’t do it either… kidding! But in all seriousness…

Active Versus Passive FTP on Windows 2003

For the first bit, please refer to Slacksite’s article for an excellent writeup on the difference between Active and Passive FTP.

Windows IIS’s FTP server is configured to use ports 1025-5000 for Passive FTP traffic by default. You can follow the steps at Microsoft’s support page to change the Passive FTP port range.

To enable Passive FTP, Windows Firewall must be configured to allow traffic from these ports. After verifying that the above port range is what you would like open to FTP traffic, each port number must be opened one by one. However, a simple script to automate this process is described here.

And here is a random link (ok, the link itself isn’t random, but the link behind the link is).

Conficker Update Part 3

According to http://forum.drweb.com/index.php?showtopic=277240 , Win32.HLLW.Shadow.based is a a variant of Conficker/downadup.

Symptom: Every available port from 1024-5000 is used to connect to various servers on destination port 445. Basically, the worm opens these connections to download and wait for malicious binaries.

The removal tools at http://www.bdtools.net/ does not detect this variant, and you have to use Dr.Web’s Cureit to detect and remove it. According to them, the recommended procedure is to install the following hotfixes:
* MS08-067
(http://www.microsoft.com/technet/security/bulletin/ms08-067.mspx);

* MS08-068
(http://www.microsoft.com/technet/security/bulletin/ms08-068.mspx);

* MS09-001
(http://www.microsoft.com/technet/security/bulletin/ms09-001.mspx).

And then run Cureit, a fully functional shareware app.

In case you’re reading this from an infected server, I’ve downloaded and included some of these files here (because if you’re infected, you won’t be able to access certain sites, drweb.com being one).

« Previous PageNext Page »