Apollo Connecting the World

Diligence and Intelligence

Posts Tagged ‘password

[zz]MSN被盗记:血泪和教训

leave a comment »

从MSN帐号被盗至今一周,我的生活完全被这场风波给打乱。我从来没有想过一个网络世界的聊天工具会给这个真实世界带来如此大的影响。短短一周,这个骗子获得了我无数家人朋友同学的信任。就我所知就有10人以上受骗,其中有三位我的朋友被骗的钱款——从700到2000人民币——至今无法追回,也应该是无法追回了。我觉得非常非常歉疚,但同时也非常感激我善良的朋友们对我的信任。人性本善,只是这个世界太疯狂。我想与其继续抱怨感叹,不如把我的经历写下来,供大家参考。

——————————————————————————————————————————————
事情的源头是我收到了一个台湾朋友的MSN留言:^^幫我部落格衝衝人氣喔^^+网址。因为是台湾朋友,他平时用的也确实是繁体字,所以我没多想就点击了那个链接。之后打开了一个长得跟Hotmail很像的界面,并提示得输入MSN的用户名和密码才能阅读那个所谓的部落格。天真的我竟然就这么把帐号密码输了进去。事后BF跟我说,这根本不是黑客行为,这是我自己把帐号信息“告诉”了骗子!

教训一:在任何情况下,千万不要点击任何未知的网站链接,哪怕是来自你最亲密的家人朋友!

Read the rest of this entry »

Written by apollozhao

2011/09/17 at 13:55

Do not type password when ssh to a remote machine

leave a comment »

Sometimes you may feel it annoying to type password to ssh onto a remote machine, especially when you are running an automated program which involves ssh to other machines and run commands. Here is a method that enable a user to ssh without typing password.

Principle:
a) Create a key pair on local machine
b) Put the publick key on the remote machine, keep the private key on local machine
c) When ssh to the remote machine, the private & public key matching will be done, and matching will lead to the logging

Assuming there are three machines. A: local machine. B,C: remote machines you want to ssh to.

1. On local machine A, run:
$ssh-keygen -t rsa -f ~/.ssh/id_rsa

This command will generate an rsa key pair. “id_rsa” is the private key, and “id_rsa.pub” is the public key.
(Or you can run: ssh-keygen -t rsa, and do according to the prompted info)

When you are asked to enter passphrase, simply leave it empty. (If you have ssh-agent on A, then you can enter the passphrase. Or you still have to enter this passphrase every you ssh to B and C)

Note:
You have to set the privilege of id_rsa on local machine to:600:
$chmod 600 ~/.ssh/id_rsa

2. Append the content of id_rsa.pub to “~/.ssh/authorized_keys” on remote machine B and C.
In a terminal of the local machine, type:
$cat ~/.ssh/id_rsa.pub | ssh yourname@machineB “cat – >> ~/.ssh/authorized_keys”

Or you can upload the public key to the machine B, and in machine B, do:
$cat id_rsa.pub >> .ssh/authorized_keys

Note:
Maybe machine B and C have to restart the ssh service:
$sudo /etc/init.d/ssh restart # on machine B and C
(works on Ubuntu, similar in other Linux)

3. If A has ssh-agent, and you entered a passphrase when generating the RSA key pair, then run:
$ssh-add
and do according to the prompted information.
And then you can ssh without entering password

Written by apollozhao

2010/03/03 at 13:47

Posted in Linux, ssh

Tagged with , ,