Rootop 服务器运维与web架构

2023-08-24
发表者 Venus
juniper配置dnat规则并配置安全策略已关闭评论

juniper配置dnat规则并配置安全策略

# 添加pool用于dnat时匹配要转发到的目的地址及端口
root@juniper1# set security nat destination pool kibana address 10.1.2.5 port 5601    
root@juniper1# set security nat destination pool es description "elasticsearch port" address 10.1.2.5 port 9200    

# 查看pool(用问号?提示时会显示出来所有的pool)
root@juniper1# show security nat destination pool kibana 
address 10.1.2.5/32 port 5601;

# 查看dnat规则集,ssh为规则集名
root@juniper1# show security nat destination rule-set ssh    

# 添加具体的规则到某个规则集,es为规则名
root@juniper1# set security nat destination rule-set ssh rule es description "elasticsearch" match destination-address 174.71.214.155     
root@juniper1# set security nat destination rule-set ssh rule es description "elasticsearch" match protocol tcp destination-port 9200    
root@juniper1# set security nat destination rule-set ssh rule es then destination-nat pool es    
root@juniper1# commit 


# 查看所有服务,也就是安全策略中的 services
root@juniper1# show applications 

# 通过问号可以显示所有的服务名
root@juniper1# show applications application ? 

# 通过指定服务名,可以查看此服务的协议端口信息
root@juniper1# show applications application es 

# 创建用户自定义应用服务,服务名叫es
root@juniper1# set applications application es protocol tcp destination-port 9200 description elasticsearch 

# 删除一条自定义服务
root@juniper1# delete applications application es    

# 查看安全策略
root@juniper1# show security policies from-zone untrust to-zone trust 

# 安全策略,往一个已有的策略中添加一个新服务,已有的策略名为 ping,服务名为 es
root@juniper1# set security policies from-zone untrust to-zone trust policy ping match application es

# 或者创建一个新策略
root@juniper1# set security policies from-zone untrust to-zone trust policy es then permit 
root@juniper1# set security policies from-zone untrust to-zone trust policy es match application es

root@juniper1# commit 

2023-08-15
发表者 Venus
x-ui搭建的socks5不能访问公司内网服务器已关闭评论

x-ui搭建的socks5不能访问公司内网服务器

为了方便在家里远程连接公司内部的服务器,比如远程桌面、ssh。
在公司内部使用x-ui搭建了socks5代理,配合proxifier客户端匹配代理mstsc.exe进程。
结果就是连不通内网资源,但是用来连接外部服务器是可以。


给配置文件中开启日志记录,最后发现是配置模版中给屏蔽私有网段的访问了。

  {
	"ip": [
	  "geoip:private"
	],
	"outboundTag": "blocked",
	"type": "field"
  }

2023-08-11
发表者 Venus
vmware ESXi web登录提示incorrect user name or password已关闭评论

vmware ESXi web登录提示incorrect user name or password

esxi虚拟化web登录时提示错误:
Cannot complete login due to an incorrect user name or password.
此处弹这个提示是因为在控制台修改了密码,用新密码可以登录esxi控制台,说明密码是正确的。
只是web端没有生效。

解决方法就是重启management agent服务:

进入esxi控制台,依次找到

再登录就可以了。

2023-08-09
发表者 Venus
使用ovftool导出虚拟机模版已关闭评论

使用ovftool导出虚拟机模版

使用浏览器导出时会报错:无法下载,网络问题。不管是chrome还是edge都这样。
更换ovftool工具导出。

ovf -> Open Virtualization Format
下载链接:https://customerconnect.vmware.com/cn/downloads/details?downloadGroup=OVFTOOL430&productId=742

命令提示符里进入安装目录:

C:\Program Files\VMware\VMware OVF Tool>.\ovftool.exe vi://root@10.1.2.3/centos7 c:\
Accept SSL fingerprint (5E:43:82:E1:65:5D:22:5C:89:6F:67:A6:2B:6C:92:9C:44:91:F8:5D) for host 10.1.2.3 as source type.
Fingerprint will be added to the known host file
Write 'yes' or 'no'
yes
Enter login information for source vi://10.1.2.3/
Username: root
Password: *********
Opening VI source: vi://root@10.1.2.3:443/centos7
Opening OVF target: c:\
Writing OVF package: c:\centos7\centos7.ovf
Transfer Completed
Completed successfully

10.1.2.3 为虚拟化机器的ip
centos7为虚拟机名
就会导出到c盘下,并以虚拟机名新建一个文件夹。

2023-08-03
发表者 Venus
使用python或者php启动一个小型web服务已关闭评论

使用python或者php启动一个小型web服务

适合作为一个临时web服务器,下载站,文件中专,或者测端口连通性。

# python2版本 把当前目录作为网站根目录

$ python -m SimpleHTTPServer 8888

# python3版本 把当前目录作为网站根目录

$ python -m http.server 8888

# php

$ php -S 0.0.0.0:8888 -t ./

-t 参数指定目录作为网站目录,不加的话也是当前目录作为网站根目录。
放入一个php文件,可以直接访问。