Showing posts with label ssh. Show all posts
Showing posts with label ssh. Show all posts

2011-12-23

libfipscheck

Another yum mess:
After an apparently successfull yum update, sshd didn't start with the following error message:

/usr/lib/libfipscheck.so.1: file too short

The file was 0 bytes.
Where does it come from?

# yum provides libfipscheck.so.1

fipscheck-lib-1.2.0-1.el5.i386 : Library files for fipscheck
Repo        : rhel-5.5-x86_64
Matched from:
Other       : libfipscheck.so.1

the package was installed but somewhat corrupted, so I reinstalled it:

# yum reinstall fipscheck-lib

after that, sshd started fine.

2011-08-21

Copying files with on-the-fly compression

having to copy a really big file in the shortest time, this might be useful:

gzip -1 </path/to/sourcefile | ssh -c blowfish-cbc target.host gunzip ">" /path/to/destfile

the light compression (-1) seems to be a good tradeoff: higher compression ratios lead to higher overall transfer time.
the blowfish encryption puts lower strain on the cpu.
using an old 10 Mbit connection, i've copied a vm disk file with a throughput of 13.980.000 bytes/sec

2011-08-15

Sending commands to your PC from your Android phone.

You'll need: ConnectBot (free on the android market) on the phone, linux on the pc (I've used Ubuntu, but any will do).
First, make sure ssh is enabled PC side. If you PC has a public internet address you'll be able to send commands to it from the other side of the globe, otherwise, as my own setup, you can use the home wi-fi to control it from other rooms.
On the phone, using ConnectBot generate an RSA key pair.
Be sure to check "load at startup".
Then export the public key to your PC (by means of copy/paste via email for example).
On the PC, in your home dir of create a file named .ssh/authorized_keys as follows:

command="sudo shutdown -h now" ssh-rsa AAAAxxxxxc2EAAAADAQABAAAAgQDbTVtZxxxxRz+8EINWYbYvsD/dla30xxxx8LJiQrzgoLmFdTmM7FW+X//dmijMli8xxxx4yWVq/UTeGSDpc/drT4H3Csj7SSLnDksjxxxZqAZwTIncxxxxwu9VL5O6fqnxOWBh2+efnZV3+e2tbiGhqQ== username

You can put any command as you wish as the first token, and you'll need to paste your public key after ssh-rsa.
Create a new ConnectBot connection on the phone. Be sure to select public key authentication using the key you've generated before.
You can even create a shortcut on the phone desktop referring to the connection. This way with a single click on the phone you can issue commands on the pc.