Squirreling

storing bits of the internet away for a rainy day

Archive for June, 2008

Install Debian testing packages

Posted by squirreling on June 11, 2008

http://forums.spry.com/showthread.php?t=620

The solution for keeping stable and installing the package is to modify apt-get configuration to setup what is called a mixed system:
-create or modify the /etc/apt/apt.conf file and make it contain the following line:

Code:
APT::Default-Release "stable";

-modify the /etc/apt/sources.list file: copy all the lines containing stable (or etch), insert them at the end of the file, and replace the stable in the lines you just added by testing. You must have all the original lines in the files plus all the lines where stable has been replaced by testing.
-run apt-get update to update the list of installable packages.
-if you want to install the package foo that is present in the testing sources, use the following command:

Code:
apt-get -t testing install foo

Be very careful about which packages you install from testing. By definition they are not as stable as the packages found in the stable distribution.

Posted in Uncategorized | Leave a Comment »

Passwordless ssh

Posted by squirreling on June 11, 2008

http://linuxproblem.org/art_9.html

SSH login without password

Your aim

You want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host local / user me to Host remote / user metoo. You don’t want to enter any passwords, because you want to call ssh from a within a shell script.

How to do it

First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:

me@local:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/me/.ssh/id_rsa):
Created directory '/home/me/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/me/.ssh/id_rsa.
Your public key has been saved in /home/me/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 me@local
me@local:~> chmod 600 /home/me/.ssh/id_rsa

Now use ssh to create a directory ~/.ssh as user metoo on remote. (The directory may already exist, which is fine):

me@local:~> ssh metoo@remote mkdir -p .ssh && chmod 700 .ssh
metoo@remote's password:

Finally append a’s new public key to metoo@remote:.ssh/authorized_keys and enter metoo’s password one last time:

me@local:~> cat .ssh/id_rsa.pub | ssh metoo@remote 'cat >> 
.ssh/authorized_keys'
metoo@remote's password:
me@local:~> ssh metoo@remote chmod 644 .ssh/authorized_keys
metoo@remote's password:

From now on you can log into remote as metoo from local as me without password:

me@local:~> ssh metoo@remote hostname
remote

Keywords: ssh openssh password Author: Mathias Kettner

* Edited by me to change the users/hosts to me@local and metoo@remote

* Edited so that files have correct permissions. The .ssh directory should be 700, the .ssh/id_rsa should be 600, and the .ssh/authorized_keys file should be 644. Added troubleshooting section. Thanks to this thread for help setting up passwordless ssh on fedora.

Troubleshooting:

  • On the remote machine, kill sshd (try ‘sudo /etc/init.d/sshd stop’ or ‘sudo pkill sshd’)
  • Run sshd on the remote machine with ‘sshd -dd -e’ to view verbose output
  • Open a new terminal on the local machine and try to login to the remote (‘ssh -v metoo@remote’)
  • Look for any error messages in the output. Fix them then restart sshd. (‘sudo /etc/init.d/sshd start’)

Posted in Uncategorized | Leave a Comment »

Creating a bootable USB from an iso

Posted by squirreling on June 7, 2008

From Damn Small Linux
Convert .iso to USB installation

With the guide from [1] you can install the .iso contents non-destructively onto a USB partition. Leave out all the partitioning or formating stuff to prepare an existing and used USB drive for DSL booting:

Note: All path names are examples! Please adapt or you may corrupt existing partitions or files.

  1. Mount USB drive, with e.g. mount /dev/sdx1 /flash – can be either FAT16 or FAT32!
  2. Mount ISO image, with e.g. mount /tmp/dsl-3.2.iso /tmp/iso -o loop
  3. Copy all contents from ISO to USB drive: cp -vr /tmp/iso/* /flash/
  4. Rename and move syslinux files to root directory: mv /flash/boot/isolinux/* /flash/
  5. Rename isolinux.cfg: mv /flash/isolinux.cfg /flash/syslinux.cfg
  6. Unmount USB drive: umount /flash
  7. Install syslinux: syslinux /dev/sdx1 and eventually set the MBR boot flag for this partition (with fdisk).

Posted in Uncategorized | 1 Comment »