Assign fix IP to an ethernet interface on Ubuntu Assign fix IP to an ethernet interface on Ubuntu

April 12th, 2007

Edit /etc/network/interfaces, and do it like this below:

Make sure, you have all interfaces listed and automatically started:


auto lo eth0 eth1
iface lo inet loopback

First uncomment the DHCP, if it was active for eth0:


# The primary network interface
#auto eth0
#iface eth0 inet dhcp

Now you can enter the fixed values for eth0:


#custom
iface eth0 inet static
address 10.1.1.233
netmask 255.255.255.0
network 10.1.1.0
broadcast 10.1.1.255
gateway 10.1.1.254

If you have more interfaces, type all in as abowe.

iface eth1 inet static
address 80.xx.xx.xx
netmask 255.255.255.0
broadcast 80.xx.xx.254
network 80.xx.xx.0

Configure pptpd vpn with ms-chapv2 and mppe on Ubuntu Configure pptpd vpn with ms-chapv2 and mppe on Ubuntu

April 2nd, 2007

We’ve installed a NAT+VPN to get rid of Microsoft’s one, and implemented the same functionality with PoPToP version 1.3.0.

The necessary settings are the following:

1) try if you have the necessary kernel modules (in Ubuntu 6.10, all is included. if you don’t have them, you’re doomed - you need to re-compile your kernel)

modprobe ppp_mppe
modprobe ip_gre

if the reply is the well known unix’s golden silence, you need to add the modules to /etc/modules:

ppp_mppe
ip_gre

to have it loaded, and reboot.

2) Install pptpd

apt-get install pptpd

3) in /etc/pptpd.conf, have the following:

option /etc/ppp/options.pptpd
speed 115200
localip 10.1.1.10 #our eth0
remoteip 10.1.1.228-238 #our ip stack
listen xx.xx.xx.250 #our eth1

4) change /etc/ppp/options to the following:

lock
noauth
refuse-eap
refuse-chap
refuse-mschap
nobsdcomp
nodeflate
require-mppe-128

5) in /etc/ppp/pap-secrets, don’t forget to add the blank user and password
* *

4) use the following settings in /etc/ppp/options.pptp:

lock
name pptpd
proxyarp
asyncmap 0
-chap
-mschap
+mschap-v2
require-mppe
lcp-echo-failure 30
lcp-echo-interval 5
ipcp-accept-local
ipcp-accept-remote

This setup will work with any Windows 2000/XP client, and all pptp configs on Linuxes. (with regards to http://poptop.sourceforge.net/dox/radius_mysql.html)

Enjoy ;)

Install XServer and Xfce4 on Ubuntu Server Install XServer and Xfce4 on Ubuntu Server

April 2nd, 2007

I just wanted to have a nice GUI on a test environment, so without getting 200 megabytes for xubuntu-desktop or 524 megabytes for ubuntu-desktop, I simply installed the following:


apt-get install xserver-xorg
apt-get install xfce4

with these packages - only about 40 megabytes to download - you’ll have a clean and working desktop.
I found some errors, possibly because I previously installed X.org, that I needed to

ln /usr/X11/Xorg -> /etc/X11/X

first, then

sudo Xorg -configure

to let it happen:)

NOTE: *make sure to have a mouse and a keyboard attached* or this setup will be broken.
Of course, you can enter

Option "AllowMouseOpenFail" "1"

into your xorg.conf > Section “ServerLayout”

If you too configure it via ssh and start X by error, and see the .XAthority file locked error, type:

xauth -b quit

WinSCP + RemotelyAnywhere’s SSH server + other drives than C: WinSCP + RemotelyAnywhere’s SSH server + other drives than C:

March 29th, 2007

Well, if you want to use another drive than C: with the above config, open WinSCP (I use the FAR plugin) and on the remote directory tab type in: /d/directory_you_want_to_use

OpenSSH and network drives on Windows OpenSSH and network drives on Windows

March 19th, 2007

I’m using OpenSSH 3.x on all servers both Windows and Linux / Unix and Macs as well to remotely access files and services. With OpenSSH for Windows I faced with the following error:


C:\unix\Console2>ssh servername.hu -l balint
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/cygdrive/x/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /cygdrive/x/.ssh/id_rsa
Enter passphrase for key '/cygdrive/x/.ssh/id_rsa':

This is of course not the way it should be - it should normaly authenticate with the keyfiles; however on Windows we don’t have chmod to change the permissions. It turned out, that NT rights are not successfuly loaded with Cygwin, if your files are on a network drive - and X: is a remote server for me.

So - instead of running unnecessary circles: we can change the CYGDRIVE and the CYGPATH variables (even temporarily) to check our .ssh folder on a local path:


set CYGDRIVE=c:
set CYGPATH=\unix

copy x:\.shh c:\unix\.shh

And voila:


C:\unix\Console2>ssh servername.hu -l balint
Last login: Mon Mar 19 17:11:58 2007 from xx.xx.xx.140
[balint@servername.hu ~]$

Create the ’service’ command on other linuxes Create the ’service’ command on other linuxes

February 28th, 2007

#!/bin/sh

set -e

/etc/init.d/$1 $2 $3

I found this tip at linux-noob. Thanks!

Nslookup for Linux: dig Nslookup for Linux: dig

February 27th, 2007

I’ve recently found out on my Mac, that nslookup will be obsolete; and we need to use dig instead of this well known tool. If you want to install it on Fedora, just type:
apt-get install bind-utils

Mount an OS X shared folder on Linux Mount an OS X shared folder on Linux

February 22nd, 2007

Title says it all: mount -t nfs [mac's ip or name]:Users/Shared /mnt/[mountfolder]

OS X kexts knowhow OS X kexts knowhow

February 7th, 2007

I have some Mac OS Xs around me (Intel and PPC ones as well), and usually I find the opportunity to create a nice kernel panic :] But I always forget how to list the already loaded kernel extensions:

kextstat

To load a kernel extension, type:

kextload /System/Library/SomeCool.kext

to unload a kext, type:

kextunload /System/Library/SomeCool.kext

If you want to replace any kexts, just simply copy over as root (i usually do it in midnight commander) and after say:

chmod -R 755 /System/Library/Extensions/SomeCool.kext

chown -R root:wheel /System/Library/Extensions/SomeCool.kext

and clear the kernel cache:

kextcache -k /System/Library/Extensions/

Menu Editor for Firefox - get rid of boring contectual (right click) menu items Menu Editor for Firefox - get rid of boring contectual (right click) menu items

February 7th, 2007

I always wondered how to hide the unused menu items in Firefox - here’s the solution: download Menu Editor from Mozdev.org!