Thursday 18 December 2008

Fedora 10 package you need to compile kernel or build module

You have to download packages below.
# yum install yum-utils rpmdevtools
# yum install kernel-devel-$(uname -r)

Create user in Linux via vbscript

You can combine with previous script to handle creating users for AD and linux together.
I use plink to connect and execute useradd and passwd commands.
Edit sudo file to give these permissions to a user execute two command useradd and sudo. Do not forget to encrypt vbscript.


Dim strUser, strName, strContainer
strUser = InputBox (" Create user","username","")
strName = InputBox ("Name Surname","Name Surname","")
'if you want usernames in lowercase
'strUser = Lcase(StrUser)

' Check username length
If Len(strUser) = 0 Then
wscript.echo "empty username ?"
wscript.quit
End If

call Useradd(strUser)



Function Useradd(strUser)
Set WSHShell = WScript.CreateObject("WScript.Shell")
rc=WshShell.Run("c:\windows\plink.exe AUSERHAVINGSUDO@10.200.124.135 -pw password useradd -d /home/"&

strUser &" -s /bin/csh -c " & strUser & " -m " & strUser , 1, FALSE)
if err.number <> 0 Then
wscript.echo "problem creating user for linux"
wscript.quit
End if
End Function

Create user in AD, vbscript

Create and enable user in active directory environment. Set default password, and force user to change password in first logon.


Dim objRootLDAP, objContainer, objUser, objShell
Dim strUser, strName, strContainer
strUser = InputBox (" Create user","username","")
strName = InputBox ("Name Surname","Name Surname","")
'if you want usernames in lowercase
'strUser = Lcase(StrUser)

' Check username length
If Len(strUser) = 0 Then
wscript.echo "empty username ?"
wscript.quit
End If


call ADCreateUser(strUser,strName)



Function ADCreateUser(strUser,strName)
' parameters
' strName = strUser
strNewPasswd = "NA"&strUser&"99"
strContainer = "OU=YOUROU ,"

wscript.echo "username: " & strUser & " password: " & strNewPasswd

' Bind to Active Directory, Users container.
Set objRootLDAP = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://" & strContainer & objRootLDAP.Get("defaultNamingContext"))

' create user.
Set objUser = objContainer.Create("User", "cn=" & strUser)
objUser.Put "sAMAccountName", strUser
objUser.Put "displayName", strName
objUser.SetInfo

'Password set
objUser.Put "userAccountControl", 512
objUser.Put "PwdLastSet", 0
objUser.SetPassword(strNewPasswd)
objUser.SetInfo


End Function

Wednesday 17 December 2008

Fedora 10 Installation from hard disk without cd/dvd or usb

I have running Fedora 6 and enough disk space to hold fedora 10 dvd iso.
Main idea is using initrd.img and vmlinuz under isolinux directory of dvd iso. Put them under /boot directory, edit grub.conf and boot from that kernel.

Downloaded Fedora-10-i386-DVD.iso to /mnt/disk2part1
Disk2part1 is /dev/hdc1 or /dev/sdc1.

# cd /mnt/disk2part1
# mkdir test
# mkdir images
# mount -o loop Fedora-10-i386-DVD.iso test
# cd test/isolinux
# cp initrd.img /boot/fedora10initrd.img
# cp vmlinuz /boot/fedora10vmlinuz
# cd ../images/
# cp install.img ../../images/

Now edit /boot/grub/grub.conf and add lines below

title Install Fedora 10
root (hd0,0)
kernel /fedora10vmlinuz
initrd /fedora10initrd.img

You should know where is your /boot directory. For me(hd0,0).
I select "install fedora 10" in boot screen and hard disk installation method.

webmin ssl_error_rx_record_too_long error

Install perl-Net-SSLeay module.
# yum inatall perl-Net-SSLeay

Now you can use ssl for webmin.