服务端192.168.0.21:
1)将/etc/ssh/sshd_config中的内容全注释掉
2)重启sshd
3)建用户www
4)设权限
~/.ssh/ 755
~/.ssh/authorized_keys 644
客户端192.168.0.20:
1)Root登录:
# mkdir /home/www
# useradd –g users –d /home/www/advertisement www
# cd /home/www
# chmod o+rw advertisement/
# hostname 192.168.0.20
2) 以www用户登录
$ ssh-keygen –t rsa 一路回车
$ scp ~/.ssh/id_rsa.pub 192.168.0.21:~/.ssh/authorized_keys