2012年7月30日星期一
ssh连接被远程关闭解决方案
This works for me:
# cd ~/.ssh
# ssh-keygen -t rsa -f id_rsa
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
xx:xx:xx:08:d1:d1:29:da:29:8b: 8f:c3:de:xx:xx:xx user@system
Log in as the intended user on the target machine. Add the public key
(id_rsa.pub) to ~/.ssh/authorized_keys. The file should look something
like this.
ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAIEAtf jDtf/xhw2trKYAJ61MmzADkG+ 0ma7DrvIqjoRUswfPglRWrbDpD+An
A72dzJB8UcLCMB0jyEhNz3yN/ tH8FQ4JAHQDDWyt47wAqf1PZGxxsXx xxxxxxxxxkx1ke4PM17rH5IK7uxJ5A nOU8jCJvXUxbdaYdReWnBSpInJHotE =
root@system
Note that this is all on one line. If you accidentally split it over
multiple lines, you'll get something like this:
# scp file user@system:/tmp
Connection closed by 10.10.16.10
lost connection
On system, you'll see something like the error below in /var/adm/messages
Jul 7 11:48:18 system sshd[26022]: [ID 800047 auth.crit] fatal:
buffer_get: trying to get more bytes 129 than in buffer 34
# cd ~/.ssh
# ssh-keygen -t rsa -f id_rsa
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
xx:xx:xx:08:d1:d1:29:da:29:8b:
Log in as the intended user on the target machine. Add the public key
(id_rsa.pub) to ~/.ssh/authorized_keys. The file should look something
like this.
ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAIEAtf
A72dzJB8UcLCMB0jyEhNz3yN/
root@system
Note that this is all on one line. If you accidentally split it over
multiple lines, you'll get something like this:
# scp file user@system:/tmp
Connection closed by 10.10.16.10
lost connection
On system, you'll see something like the error below in /var/adm/messages
Jul 7 11:48:18 system sshd[26022]: [ID 800047 auth.crit] fatal:
buffer_get: trying to get more bytes 129 than in buffer 34
2012年7月7日星期六
top vi command
http://www.oualline.com/vim/10/top_10.html
比较有用的
split - 分割多窗口
v - 可视化模式
> - 右缩进
ctrl-q - 进入列模式
cindent - 自动用c的缩进
make - 执行make,按:cn跳到下一个错误,:cc查看当前错误
ctags - 生成索引文件(支持多种编程语言), vim -t a_function,直接打开a_function的定义文件,并跳到定义处。ctrl-]可以跳到函数定义,ctrl=T跳回调用处。
ab - 定义缩写宏,vi会自动替换
智能补齐,ctrl+p, ctrl+n
复合搜索,/;/分割,/{file}+1/;/echo/
重放搜索, :%s/^\(Martin\)/Mr \1 Wicks/g
切换大小写, Escape [n] ~
截取特定行另存,:6,9w >> /tmp/newfile
标记行光标移到该行上,键入mx(x 是任何一个小写字母)就可以了。`x可以跳到指定标记处。··跳到上一个标记处。
撤消上一个编辑操作。 U
重复上一个编辑操作。 .
还原被撤消的编辑操作。 Ctrl + R
比较有用的
split - 分割多窗口
v - 可视化模式
> - 右缩进
ctrl-q - 进入列模式
cindent - 自动用c的缩进
make - 执行make,按:cn跳到下一个错误,:cc查看当前错误
ctags - 生成索引文件(支持多种编程语言), vim -t a_function,直接打开a_function的定义文件,并跳到定义处。ctrl-]可以跳到函数定义,ctrl=T跳回调用处。
ab - 定义缩写宏,vi会自动替换
智能补齐,ctrl+p, ctrl+n
复合搜索,/;/分割,/{file}+1/;/echo/
重放搜索, :%s/^\(Martin\)/Mr \1 Wicks/g
切换大小写, Escape [n] ~
截取特定行另存,:6,9w >> /tmp/newfile
标记行光标移到该行上,键入mx(x 是任何一个小写字母)就可以了。`x可以跳到指定标记处。··跳到上一个标记处。
撤消上一个编辑操作。 U
重复上一个编辑操作。 .
还原被撤消的编辑操作。 Ctrl + R
订阅:
博文 (Atom)