Chinaunix首页 | 论坛 | 博客
  • 博客访问: 467443
  • 博文数量: 122
  • 博客积分: 5000
  • 博客等级: 大校
  • 技术积分: 1540
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-26 11:11
文章分类

全部博文(122)

文章存档

2010年(1)

2009年(76)

2008年(45)

我的朋友

分类: LINUX

2010-04-21 21:45:27

每次都scp还是很麻烦,而且scp不是很方便,效率不高。
NFS不错,把远程mount到本地,但需要配置server,太懒,能省则省。
一个实验室内,经常需要不同人之间文件交流,总不能要其他电脑都配置成server, 明显很麻烦。

最后发现sshfs不错,解决以上问题,只要ssh登录即可实现挂载到本地使用,方便又省心。

# aptitab intab sshfs
这样,安装完,可以用了。

$ sshfs alyan@192.168.0.123: /home/alyan mnt
这样,把alyan在123上的主目录整个挂载到当前mnt目录,如同本地磁盘。
sshfs是好东西,完工。

----------------------------------------

另外,使用ssh(scp, sshfs, ssh) ,每次都有敲密码太麻烦了, 使用ssh证书登录省去
输密码的麻烦:
(by nnaabbcc)

nnaabbcc@debian-nnaabbcc:~/.ssh$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/nnaabbcc/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/nnaabbcc/.ssh/id_rsa.
Your public key has been saved in /home/nnaabbcc/.ssh/id_rsa.pub.
The key fingerprint is:
8a:61:9b:55:0b:fc:df:87:c7:a4:a6:40:2d:f8:8b:86 nnaabbcc@debian-nnaabbcc
The key's randomart image is:
+--[ RSA 2048]----+
| |
| . |
| o . |
| = o |
| o o S . . |
| . * + o . = |
| +.. o . = + |
| E .. o o o |
| .. . . |
+-----------------+
nnaabbcc@debian-nnaabbcc:~/.ssh$ ls
id_rsa id_rsa.pub known_hosts
其中询问一律直接回车,将生成的公钥id_rsa.pub提交到远程服务器
nnaabbcc@debian-nnaabbcc:~/.ssh$ ssh-copy-id -i id_rsa.pub nnaabbcc@192.168.0.123
nnaabbcc@192.168.0.123's password:
Now try logging into the machine, with "ssh 'nnaabbcc@192.168.0.123'", and
check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.
登录远程服务器
nnaabbcc@debian-nnaabbcc:~/.ssh$ ssh nnaabbcc@192.168.0.123
Linux optlab 2.6.26-2-686 #1 SMP Sat Oct 17 17:59:23 UTC 2009 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
Last login: Sat Oct 31 16:51:50 2009 from 192.168.0.115
OK,不需要敲入密码可以直接登录了。
阅读(1268) | 评论(0) | 转发(0) |
0

上一篇:VIM 和 cmd.exe 批量化自动编译执行

下一篇:没有了

给主人留下些什么吧!~~