notes 鸟哥-鸟哥的Linux私房菜 服务器架设篇 3ed

11 远程连接服务器 ssh xdmcp vnc xrdp

11-1 远程连接服务器

11-2 文字接口连接服务器:ssh服务器

11-2-2 启动ssh服务器

google centos 7 netstat
http://www.centoscn.com/CentOS/config/2014/0905/3681.html
yum install net-tools

google centos 7 etc init.d sshd
http://www.putorius.net/2014/07/restarting-services-in-red-hat-7-or.html
systemctl restart sshd.service

#google centos 7 etc init.d sshd
systemctl restart sshd.service
netstat -tlnp

ssh -p22 root@127.0.0.1

exit

11-2-3 ssh客户端连接程序——linux用户

google ssh mkdir
http://unix.stackexchange.com/questions/8612/programmatically-creating-a-remote-directory-using-ssh
ssh remote-host-ip ‘. ~/your_profile; mkdir your_directory’

google cli socks5
http://askubuntu.com/questions/610333/how-to-set-socks5-proxy-in-the-terminal
sudo proxychains4 apt-get update

ssh:直接登录远程主机的指令:

rm ~/find.log
ssh -p22 root@127.0.0.1 find / &> ~/find.log #没有-f会等待指令完毕

ls ~ #需要分开执行,因为没有-f选项

rm ~/find.log
ssh -p22 root@127.0.0.1 -f 'find /' &> ~/find.log #返回log到客户端而不是服务器
ls ~

sum: find /在服务器执行,重定向到本地服务器。这个演示server和client的交互
完全在服务器执行需要加上引号,ssh -p22 root@127.0.0.1 'find / &> ~/find.log ; ls ~'

服务器公钥记录文件:

cat ~/.ssh/known_hosts

sftp:

cd ~
touch ./client.txt
sftp -P22 root
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值