Archive for the 'Linux' Category

Mac-Adresse / Hardware-Adresse ändern (Linux)

1.Terminal öffnen

2. ifconfig eth1 eintippen, wenn das nicht funktioniert eth0 ausprobieren… Jetzt sollte in etwa das hier zu sehen sein:

eth1 Protokoll:Ethernet Hardware Adresse 00:**:4*:31:E*:8*
inet Adresse:192.168.1.** Bcast:192.168.1.*** Maske:255.255.255.0
inet6 Adresse: fe80::21*:49ff:*****:ea**/** Gültigkeitsbereich:Verbindung
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:170771 errors:1620 dropped:376 overruns:0 frame:1574
TX packets:77850 errors:18 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:1000
RX bytes:253520743 (241.7 MB) TX bytes:5812160 (5.5 MB)
Die Hardwareadresse ist die Mac-Adresse!

Jetzt fahren wir die Netzwerkkarte runter:

ifconfig eth1 down

Und tippen jetzt folgenden Befehl ein:


ifconfig hw ether **:**:5*:**:*G:DE

* sind hier Zahlen, Buchstaben müssen durch Buchstaben ersetzt werden! Nach der Bestätigung mit Enter habt ihr eine neue Mac-Adresse!

Jetzt kann man noch mit

ifconfig eth1

nachsehen, ob die Änderungen auch wirklich übernommen wurden(Hardware-Adresse)!

Bei notebooks sollte man die Mac-Adresse regelmäßig wechseln!

Dateien sicher löschen unter Linux (Ubuntu)

Zwei wichtige Befehle:

Der erste ist shred :

shred -u /pfad/dateiname überschreibt eine Datei 25 mal (Standard).

shred -n 70 /pfad/dateiname überschreibt eine Datei 70 mal, shred -n x /pfad/dateiname, dann dementsprechend x-mal.

shred … /pfad/dateiname -v zeigt während des Überschreibens an, wie oft schon überschrieben wurde.

Die Datei ist danach noch sichtbar, besteht aber nur noch aus Datenmüll den man ohne Bedenken einfach löschen kann

Mit wipe -r /pfad/verzeichnis, also zum Beispiel wipe -r /home/user/wichtige daten wird ein Verzeichnis(hier:”wichtigedaten”) mehrfach(>20) überschrieben, wipe -r -q überschreibt ein Verzeichnis nur 4mal, das geht aber natürlich wesentlich schneller, als mit dem normalen Befehl(und ist natürlich weniger sicher!)

Vorsicht ist bei sogenannten Journaling-Dateisystemen geboten, da helfen diese Befehle nur bedingt!

How to install a .bin-file (Linux/Ubuntu)

At first you have to open a terminal/bash and then enter:

file /path/file.bin

for example file /home/user/file.bin (file is the command)

Now you should see a sentence including the word “executable” and not “non-executable, not executable,… or something completely different)

If you do not see “executable,…)” the file is probably an cd-image(BIN/CUE) and not an executable .bin-file

Now enter:

chmod +x file.bin

No path! Just the name of the file!!! Now the file is executable…

Last step: Enter

/path/file.bin

, for example /home/user/file.bin and the file will be executed…

.ace-File unter Ubuntu entpacken

1.Per Synaptic-Paketverwaltung “unace” installieren(eventuell vorher “mulitverse” als Paketquelle einbinden)

2.Terminal öffnen

3. unace e /pfad/datei.ace ins Terminal eintippen

also zum Beispiel: unace e /home/usr/paket.ace

4.Return drücken, jetzt müsste im gleichen Verzeichnis die entpackte Datei liegen

Wenn ein Fehler aufaucht, wie etwa File compressed with unknown method. Decompression not possible.”, muss vermutlich noch unace-nonfree per Paketverwaltung nachinstalliert werden!

Danach das Ganze wiederholen…

Howto: Hidden Truecrypt volume Linux

That is  more complicated than just creating a normal volume, especially if you do not know the correct commands, so I will give them to you here:

The first command(we will do all in one step, therefore the &&):

truecrypt –type normal -c volume.tc && truecrypt –type hidden -c volume.tc

As usual, you have to give the path to the volume, so an example could be:

truecrypt –type normal -c /home/usr/volume.tc && truecrypt –type hidden -c voulme.tc

Now a normal truecrypt volume will be created:

If you never did this before, have a look at my other howtos…

Filesystem:
1) FAT
2) None
Select [1]:

Enter volume size (bytes - size/sizeK/sizeM/sizeG): 5M

Hash algorithm:
1) RIPEMD-160
2) SHA-1
3) Whirlpool
Select [1]:

Encryption algorithm:
1) AES
2) Blowfish
3) CAST5
4) Serpent
5) Triple DES
6) Twofish
7) AES-Twofish 8) AES-Twofish-Serpent
9) Serpent-AES
10) Serpent-Twofish-AES
11) Twofish-Serpent
Select [1]:

Enter password for new volume ‘/home/philipp/voulme.tc’:
Re-enter password:

Enter keyfile path [none]:

TrueCrypt will now collect random data.

To enable mouse movements to be used as a source of random data,
please do one of the following:
- Run TrueCrypt under administrator (root) account.
- Add read permission for your user to device /dev/input/mice.

Please type at least 320 randomly chosen characters and then press Enter:
…(use strong random data, so RTzi*ZE$§E§Jghde and not gggggg!!!!)

Done: 5.00 MB  Speed: 2.05 MB/s  Left: 0:00:00
Volume created
.

And after that, a hidden volume, using the same scheme, be aware that the hidden volume has to be smaller than the normal volume!

Filesystem:
1) FAT
2) None
Select [1]:

Enter volume size (bytes - size/sizeK/sizeM/sizeG): 3M

Hash algorithm:
1) RIPEMD-160
2) SHA-1
3) Whirlpool
Select [1]:

Encryption algorithm:
1) AES
2) Blowfish
3) CAST5
4) Serpent
5) Triple DES
6) Twofish
7) AES-Twofish 8) AES-Twofish-Serpent
9) Serpent-AES
10) Serpent-Twofish-AES
11) Twofish-Serpent
Select [1]:

Enter password for new volume ‘/home/philipp/volume.tc’:
Re-enter password:

Enter keyfile path [none]:

TrueCrypt will now collect random data.

To enable mouse movements to be used as a source of random data,
please do one of the following:
- Run TrueCrypt under administrator (root) account.
- Add read permission for your user to device /dev/input/mice.

Please type at least 320 randomly chosen characters and then press Enter:

Done: 3.00 MB  Speed: 2.92 MB/s  Left: 0:00:00

Now you have a hidden volume inside a normal volume and it depends on the password you give, which volume will be mounted:

truecrypt -M “rw,sync,utf8,uid=$UID,umask=0007″ /home/usr/volume /home/usr/5MB

Now you will be asked for your volume password (or, at first for your root password and then for your volume password):

Enter password for ‘/home/usr/volume.tc’:

If you now give the password for the normal volume, the normal volume will be mounted, if you give the hidden volume’s password, the hidden one will be mounted

Relakks unter Ubuntu(Gnome)

Allgemeine Anmerkungen zu VPN-Anbietern und der Vertrauensfrage gibt es hier.

Installation:

Folgende Pakete müssen installiert sein:Network Manager, vpnc, network-manager-vpnc, network-manager-pptp, pptp-linux

Dazu kann man Synaptic-Paketverwaltung benutzen:

Nun klickt man auf das Symbol des Netzworkmanagers (nm-applet, Network Manager, normale rechte obere Ecke, blaube Balken oder Kabelsymbol) und klickt auf “VPN- Verbindungen, dort dann auf “VPN konfigurieren”

“Hinzufügen”

“Vor”

Verbinden mit “PPTP-Tunnel”(nicht Compatible Cisco…!!!)

Dann:

Unter Verbindung:

Verbindungsname: “Relakks”

Typ: Windows VPN (PPTP)

Gateway: pptp.relakks.com

Dann wechselt man oben auf Authentifikation:

Dort setzt man nur einen Haken bei “EAP verweigern”, sonst nirgends!

Und wechselt dann auf Verschlüsselung und Komprimierung:

Hier nur den Haken bei “128-bit MPPE-Verschlüsselung verlangen” setzen

Und wechselt zu PPP-Optionen:

Haken bei “Peer-DNS verwenden” setzen und bei “Alleiniger Gerätezugriff (UUCP-ähnliche Sperre)”

MTU 1400 (üblicherweise als einziges abzuwandeln)
MRU 1416
lcp-echo-failure 10
lcp-echo-interval 10

Routing:

Haken bei “DNS durch Tunnel ermitteln” setzen…

Jetzt “Anwenden” und dann wieder im Network-Manager die VPN-Verbindungen auswählen, auf Relakks klicken, Benutzername und Passwort eingeben und Ubuntu stellt die Verbindung her. Von Fehlermedlungen nicht entmutigen lassen, liegt normalerweise an Relakss(”VP-Verbindung konnte nicht hergestellt werden”, sondern einfach nochmal probieren, eventuell etwas später…

Relakks and Ubuntu(Gnome):

Ubuntu 7.10 Gutsy Gibbon, using Network Manager:

You have to install the following packages(programms and libaries), you can use synaptic oder terminal:

-Network Manager (should already be installed)

-vpnc

-network-manager-vpnc

-network-manager-pptp

-pptp-linux

Normally, with Network Manager installed, you shuld see some health bar or a “plug”-symbol in the right upper corner auf your desktop.

If you left-click on it, you will see your normal connections,… and beneath that “VPN-connections”

I first wanted to provide screenshots, but i have the german Ubuntu-version and so I think it would be more confusing than useful…

So you go to “VPN-coonections” and then click on “Configure VPN” ,

choose under “connect with” pptp-tunnel not Compatible Cisco…, otherwise it won’t work!

Then a new window opens, where you can configure you’re vpn-connection:

Under connection you should choose:

Connection Name: Relakks
Type: Windows (VPN) PPTP
Gateway: pptp.relakks.com

Under authencication just check “Refuse EAP”, nothing else and under “Compression and encryption” just

“Require 128 bit MPPE encryption”

Under PPP-Options you should check “Use Peer DNS” and ” Exclusive Device Access (UUPC Style lock)” and

MTU 1400
MRU 1416
lcp-echo-failure 10
lcp-echo-interval 10

Under routing check check “Peer DNS through tunnel”

Normally you should not even have to restart, just go to “VPN-connections” and click on “Relakks”, type in username and password and there you go…

Wireless connections works fine for me, but i’ve heard of many people having problems, i’m sorry, but i won’t be able to help you there…

Sometimes you receive the error message:

“VPN Connection failed”, this has normally nothing to do with your configurations, but with Relakks itself, who is often overburdened(you cannot expect anything else for only 5 euros a month). Just try again and again, an hour later,…, this error never occured to me in the morning, but only in the evening, when many people are online!

Creating a Truecrypt-volume ( Linux )

Precondition: Truecrypt is installed

1.Open your terminal, then type in

truecrypt -c

or

truecrypt –create

2.Truecrypt will now ask you whether you want a normal or a hidden volume:

Volume type:
1) Normal
2) Hidden
Select [1]:

Normal is fine for a beginner so just press “Enter”.

3.Now the path for the voulme is asked:

Enter file or device path for new volume:

Just t ype in any path you want: For example: /home/usr/tcvolume

tcvolume then would be the name of the volume:

4.Now the filesystem:

Filesystem:
1) FAT
2) None
Select [1]:

Just press “Enter”, nowadays FAT is also works quite fine under a linux-os,…

5.Now the size of the volume:

Enter volume size (bytes - size/sizeK/sizeM/sizeG):

If you want a 30 megabyte-container you type in 30M, if you want one GB, just type in 1G,…,of course there should be enough space on the harddrive…

6.Hash algorithm:

Hash algorithm:
1) RIPEMD-160
2) SHA-1
3) Whirlpool
Select [1]:

Pressing “Enter” is all you have to do…

7. Encryption algorithm:

Encryption algorithm:
1) AES
2) Blowfish
3) CAST5
4) Serpent
5) Triple DES
6) Twofish
7) AES-Twofish 8) AES-Twofish-Serpent
9) Serpent-AES
10) Serpent-Twofish-AES
11) Twofish-Serpent
Select [1]:

AES is a very secure and very fast encryption algorithm, so just take,…, it should provide more than enough security!

8. The password:

Enter password for new volume ‘/home/usr/tcvolume:

Is should be long and secure, a nonsense-sense is usually the best idea:

For example:

375 Dwarfs walk on the beach all day, playing volleyball, swimming and drinking beer. That is all they want to do.

375Dwotbad,pv,sadb.Tiatwtd.

Just make a bit more difficult:

375!Dwotbad,*pv,%sadb./Tiatwtd.§

This is a very complex password, but still quite easy to remember!

After entering the password a second time you will be asked for keyfiles, just press “Enter”

9.Truecrypt now wants to collect random data to make the key:

TrueCrypt will now collect random data.

To enable mouse movements to be used as a source of random data,
please do one of the following:
- Run TrueCrypt under administrator (root) account.
- Add read permission for your user to device /dev/input/mice.

Please type at least 320 randomly chosen characters and then press Enter:

Type in the 320 character and press “Enter”

Important: You should type in random data, so do not enter something like “aaaaaaaaaaaaaaaaaaaaa”, but “b$&/hnZgcj=3hJHGgöohfe44GJK”, “good random data” => “good key”, otherwise your key is worthless!!!

10.

Volume created.

Congratulations! You made it!

How to mount a truecrypt-volume in linux/ubuntu

That’s quite easy:

truecrypt -M “rw,sync,utf8,uid=$UID,umask=0007″
This is the command to mount your truecrypt-container/volume giving you the right to read and to write data!

After that follows the path to your truecrypt-container, for example /home/usr/tcvolume

and then the place where you want the truecrypt-container to be mounted. In Linux this can be any ordinary folder, so for example, just create a folder “truecryptvolume”, no you type in the whole path (e.g. /home/usr/truecryptvolume ), so that the whole command looks like that:

truecrypt -M “rw,sync,utf8,uid=$UID,umask=0007 /home/usr/tcvolume

/home/usr/truecryptvolume

(one line!)

Now you will be aksed for your user-or administratorpassword(sudo) and then for the volume password, if both are given correctly truecrypt will now mount your container.

By opening the folder “truecryptvolume” you will now be able to store your data encrypted.

.bin-Datei unter Linux installieren

Zuerst in der Konsole:

file pfad/datei.bin

Also zum Beispiel file /home/username/spiel.bin

Hier sollte irgendetwas mit …executable… kommen, wenn das nicht kommt ist die Datei vermutlich ein CD-Image(BIN/CUE)

Jetzt:

chmod +x datei.bin

also zum Beispiel: chmod +x spiel.bin Hier keinen Dateipfad angeben(also nicht chmod +x /home/username/spiel.bin)

Jetzt einfach den Dateipfad, um die Datei auszuführen, also

pfad/datei.bin

Beispiel: /home/username/spiel.bin