ssh login without password
LINK
Your aim
You want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. 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:
a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A
Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):
a@A:~> ssh b@B mkdir -p .ssh
b@B's password:
Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time:
a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password:
From now on you can log into B as b from A as a without password:
a@A:~> ssh b@B hostname
B
Friday, December 23, 2011
Monday, December 19, 2011
Death Love
Killing time
[00:20.02]been here so long it feels like home
[00:24.05]once i believed
[00:27.42]but this war has took so much from me
[00:31.26]the things i’ve seen
[00:34.73]the blood shed and the broken dreams
[00:38.16]they follow merelentlessly
[00:45.45]I surviveon foolish pride
[00:52.74]thinking i can save the world
[00:56.17]from sodom and their crimes
[00:59.22]but i’m aloneand the war just rages on again
[01:07.34]theres something waiting out there waiting for us
[01:11.61]and it ain’t no man
[01:14.21]so open your eyes
[01:17.97]dont let them make you sacrifice
[01:21.97]all you fight for
[01:23.89]live to dream of
[01:26.14]such a shame to hide
[01:28.87]behind all their lies
[01:32.50]the truth won’t feed you to the fire
[01:36.46]with guns and roses left behind
[01:58.38]all i have is this faded picture in my hand
[02:05.58]sad though it seems
[02:09.06]but this is who we used to be
[02:12.74]to see your face is the only thing that keeps me sane
[02:19.85]and carries me through the shame
[02:27.37]I surviveon foolish pride
[02:34.53]thinking i can save the world from sodom and their crimes
[02:40.82]but i’m alone
[02:43.43]and the war just rages on again
[02:49.18]theres something out there waiting for us
[02:53.60]and it ain’t no man
[02:56.03]so open your eyesdont let them make you sacrifice
[03:03.78]all you fight forlive to dream of such a shame to hide
[03:10.49]behind all their lies
[03:14.36]the truth won’t feed you to the fire
[03:18.32]with guns and rosesleft behind
[03:24.98]you gotta try to understand
[03:28.75]im never coming home again
[03:32.81]the earth is shaking
[03:35.03]lives are taken
[03:37.11]yet the sun still shines
[03:39.80]behind all their lies
[03:43.35]the truth won’t feed you to the fire
[03:47.40]with guns and roses left behind
[03:54.66]with guns and roses left
Friday, December 16, 2011
Bind9安装设置指南
LINK
step 1: install
$ sudo apt-get install bind9
$ sudo apt-get install bind9-host dnsutils (tools for the test)
step 2: Simply uncomment and edit the cache server,
[...]
forwarders {
1.2.3.4;
5.6.7.8;
};
(where 1.2.3.4 and 5.6.7.8 are the IP numbers of your ISP's DNS servers)
(其中 1.2.3.4 和 5.6.7.8 是您 ISP 商 DNS 服务器的 IP。
step 3: edit
[...]
zone "example.com" {
type master;
file "/etc/bind/db.example.com";
};
step 4:
Now use an existing zone file as a template
现在使用一个已有域文件作为模板
$ sudo cp /etc/bind/db.local /etc/bind/db.example.com
step 5: edit db.example.com; add 2 entry for the lab.
$TTL 604800
@ IN SOA ns1.qa-test.com. hostmaster.qa-test.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
@ IN A 127.0.0.1
@ IN AAAA ::1
bigsrv A 192.18.9.1
A 192.18.9.2
step 6: restart the bind
$ sudo /etc/init.d/bind9 restart
step 7: test.
host -t aaaa bigsrv.qa-test.com
nslookup > server x.x.x.x > bigsrv.qa-test.com