// 1. 在安装ssh服务器之前 ,first install zlib and openssl
apt-get install libz-de
apt-get install libssl-ocaml-dev;
// 2. 安装openssh-5.8p2.tar.gz
configuration make make install
配置 :Privilege separation user sshd does not exist
在/etc/passwd 中加入: sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
// 3. check version
[root@localhost ~]# openssl version -a
[root@localhost ~]# ssh -v
// 4. 启动服务器
brian@ubuntu:~/Desktop/openssh-5.8p2$ sudo /usr/local/sbin/sshd
brian@ubuntu:~/Desktop/openssh-5.8p2$ netstat -tnpl|grep :22
// 5. 客户端登录
[root@localhost ~]# ssh root@localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is 7c:4b:89:d5:57:2c:e9:7b:42:0f:94:40:76:d9:d4:b8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
root@localhost's password:
Last login: Wed Jun 15 08:59:53 2011
-bash-3.2# pwd
/root
//6. 以SSH登录后直接启动某程序:服务端设置用户以及用户登录的启动程序
set cli as shell implement after ssh login:
a. use “adduser” , add 3 user in server
// 增加用户 [root@localhost ~]# adduser engineer
// 修改密码 [root@localhost ~]# passwd manager
b. modify /etc/passwd in server
manager:x:1113:1113::/home/manager:/home/workspace_forEclipse/cli/Debug/cli
c. log in via differ user: ssh engineer@serverIP