Categories
Freebsd

Add timestamps to history

Add the following to your .bashrc:

export HISTTIMEFORMAT="%h/%d – %H:%M:%S "

The result is this:

[root@server ~]# history
    1  Mar/16 – 18:09:00 cd /etc
    2  Mar/16 – 18:09:10 vi fstab
    3  Mar/16 – 18:09:43 ls -la

Categories
Freebsd

Passwordless ssh login with keys

Create a key with no passphrase on the source machine

[install@source ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/install/.ssh/id_rsa):
Created directory ‘/home/install/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/install/.ssh/id_rsa.
Your public key has been saved in /home/install/.ssh/id_rsa.pub.
The key fingerprint is:
66:c1:3f:95:c6:a9:d6:99:49:bf:a0:57:4f:a3:78:49 install@localhost.localdomain

Copy it to the destination machine…

[install@source ~]$ scp id_rsa.pub 10.50.2.50:~

On the destination machine create the .ssh directory and copy the id_rsa.pub to authorized_keys. If you have multiple keys you can just append it, something like this “cat id_rsa.pub >> authorized_keys”

[install@destination ~]$ mkdir .ssh
[install@destination ~]$ chmod 700 .ssh
[install@destination ~]$ cp id_rsa.pub .ssh/authorized_keys

Now you should be able to login…

[install@source .ssh]$ ssh 10.50.2.50
Last login: Fri Sep  5 14:18:01 2008 from 10.50.2.51
[install@destination ~]$

Categories
Openbsd

wget through proxy tutorial

Ok so I had an issue using wget from the cmd line on my linux box, so here is how to get a proxy to work with wget:

First off export a variable called "http_proxy":

export http_proxy=192.168.1.2

This will try to get to your proxy via port 80, you could also specify like this(if you are on another port):

export http_proxy=192.168.1.2:8080

Then connect specifying your auth creds if you need to pass any:

wget –proxy-user=myusername –proxy-password=mypassword http://www.myserver.com/download/strace-4.5.15-1.el5.x86_64.rpm

 

And you should be good to go!