Hack-A-N900/First Steps: Unterschied zwischen den Versionen

aus Metalab, dem offenen Zentrum für meta-disziplinäre Magier und technisch-kreative Enthusiasten.
Wechseln zu: Navigation, Suche
(Install essential tools)
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 40: Zeile 40:
=== OpenSSH ===
=== OpenSSH ===
Install OpenSSH client and server:
apt-get install openssh
Generate ssh key:
Generate ssh key:
Zeile 77: Zeile 72:
apt-get install bash coreutils-gnu grep-gnu findutils-gnu tar-gnu wget vim
apt-get install bash coreutils-gnu grep-gnu findutils-gnu tar-gnu wget vim netcat

Aktuelle Version vom 26. April 2010, 02:47 Uhr

WARNING: That's where the pleasure and pain of N900 starts. How much pleasure and/or pain depends highly on how familiar you are with linux. So make sure you know how to accomplish simple administrative tasks via a root shell without bricking your system and do regular backups.

Root Access

Start "Application Manager", install package "rootsh" and "OpenSSH Client and Server"

Open "X-Terminal" on your N900.

Gain root access:

sudo gainroot

Add extras-testing to /etc/apt/sources.list

deb http://repository.maemo.org/extras-testing/ fremantle free non-free
deb-src http://repository.maemo.org/extras-testing/ fremantle free

Update apt cache:

apt-get update


Connect the n900 via usb to your pc and select "PC Suite Mode".

On your N900:

ifup usb0
ifconfig usb0

On your PC:

ifup usb0
ifconfig usb0

Please refer to http://wiki.maemo.org/N900_USB_networking for a complete guide.


Generate ssh key:


From this point it's more convenient to work remotely via ssh.

Copy the generated private key to your PC.

scp root@ ~/.ssh/id_rsa_n900

Put the public key to the right place:

ssh root@ "mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys"

Log on to your N900:

ssh -i ~/.ssh/id_rsa_n900 root@

change /etc/sshd_config to denied password authentication:

# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no

Install essential tools

apt-get install bash coreutils-gnu grep-gnu findutils-gnu tar-gnu wget vim netcat

Change shell in /etc/passwd to bash:


NOTE: Maemo ignores shebangs for shells and always executes shell scripts in busybox. You need to pass the script explicitly to any other shell:

bash ./test.sh

WARNING: Don't try to relink /bin/sh to /bin/bash. You system won't boot and you will have to reflash the device.

NOTE: Gnu coreutils and gnu grep are prefixed with the letter 'g'. Therefore you need to call
to use gnu ls. For some third party scripts/builds to work properly you might need to create symlinks for the gnu tools to be used.


ln -s /usr/bin/ggrep /usr/bin/grep

You might also create bash aliases for gnu utils.

$HOME/.bashrc aliases example:

# alias to gnu ls instead of busybux
alias ls='gls --color=auto'

alias ll='ls -l'
alias la='ls -la'
alias md='mkdir'
alias rd='rmdir'

# aliases to gnu grep instead of busybux
alias grep='ggrep'
alias egrep='gegrep'
alias fgrep='gfgrep'