顯示具有 SSH 標籤的文章。 顯示所有文章
顯示具有 SSH 標籤的文章。 顯示所有文章

2013年6月28日 星期五


ssh -i  identity-file(private-key)  


-i identity_file
Selects a file from which the identity (private key) for RSA or DSA authentication is read. The default is $HOME/.ssh/identity for protocol version 1, and $HOME/.ssh/id_rsa and $HOME/.ssh/id_dsa for protocol version 2. Identity files may also be specified on a per-host basis in the configuration file. It is possible to have multiple -i options (and multiple identities specified in configuration files).


2013年5月2日 星期四

2013年4月27日 星期六

如何解決sed無法立即修改隱藏檔(.filename)的問題


像我們在做SSH時,~/.ssh/known_hosts會記錄ssh過的主機,但我們有時有刪除紀錄的需要

於是下達  sed -i  '/a.b.c.d/d' ~/.ssh/known_hosts,但此時會噴出 invalid command at . 的錯誤訊息


於是得改下  sed -i ""  '/a.b.c.d/d' ~/.ssh/known_hosts 就可以解決惹

Centos必須改成 sed --in-place=""

ssh-keygen -f "/root/.ssh/known_hosts" -R x.x.x.x

http://www.markhneedham.com/blog/2011/01/14/sed-sed-1-invalid-command-code-r-on-mac-os-x/

2013年4月1日 星期一

SSH Tunneling(a.k.a SSH Port Forwarding)


Port forwarding, or tunneling, is a way to forward otherwise insecure TCP traffic through SSH Secure Shell. You can secure for example POP3, SMTP and HTTP connections that would otherwise be insecure.

Local Tunneling



Remote Tunneling