SSH


// 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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值