七月十七日(day 08) ssh登录

准备html页面
1使用yum安装nodejs环境

yum -y install epel-release
yum -y install nodejs.x86_64

node -v

2安装npm,设置npm的镜像

yum -y install npm
npm -v


3使用npm安装vue

npm config set registry https://registry.npmmirror.com
npm install @vue/cli -g
find / -name "vue"
 /usr/local/bin/vue  -V

4使用vue软件创建了vue项目   vue  create  vuehtml1000

 /usr/local/bin/vue   create vuehtml1000

5启 动项目nmp run vue

cd vuehtml1000/
npm run serve
systemctl stop firewalld     //关闭防火墙

浏览器访问虚拟机地址加8080

6将vue项目坐成一个前端项目,构建静态的html

yum -y install  nginx

nginx

npm run   build

ls
cp -R ./dist/* /usr/share/nginx/html/

 nginx -s reload

浏览器访问虚拟机地址

ssh免密登录
1关服务

systemctl stop firewalld        //关闭firewalld防⽕墙

setenforce 0      //关闭selinux

1搭建SSH服务

yum -y install openssh   

rpm -ql openssh-server

rpm -ql openssh-clients

2修改ssh服务端的配置⽂件

vim /etc/ssh/sshd_config
38⾏ PermitRootLogin no        //修改38行

root连接不上xshell,其他用户可以

3创建⽤户并授权

groupadd code

useradd -g code hhhh

passwd  hhhh    //添加密码
useradd -g code qq

passwd  qq

mkdir  /code

chgrp -R code  /code/
chmod -R g+w /code/

4登录普通用户测试

su  hhhh

touch  /code/hh.txt     //可以在code下创建文件了

5更改ssh默认端口

vim /etc/ssh/sshd_config
17⾏ Port 9999             //更改17行

systemctl restart ssh          //重启ssh服务

ssh  -lhhhh 192.168.81.13     //登录不了

ssh  -lhhhh   -p9999 192.168.81.13     //可以登录

6不使用密码登录

yum install pwgen -y

ssh-keygen         //连点三次

ssh-copy-id -p9999 hhhh@192.168.81.13

ssh -p9999 hhhh@192.168.81.13       //可以不用密码登录

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值