在ubuntu18.04中如何配置单网卡多ip呢?本文给出详细说明。
1.在网卡eth0上增加一个192.169.100.2的ip
sudo ifconfig eth0:0 192.168.100.2 netmask 255.255.255.0
2.查看增加ip后本机的ip信息
ifconfig
3.删除新增加的ip
sudo ifconfig eth0:0 down
4.查看删除后本机的IP信息
在ubuntu18.04中如何临时修改MAC地址呢?本文给出详细说明。
1.首先查看网卡信息
2.关闭网卡
sudo ifconfig eth0 down
3.修改mac地址
sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE
4.开启网卡
sudo ifconfig eth0 up
5.查看修改后的网卡信息
1.打开sshd_config文件
vi /etc/ssh/sshd_config
2.将#AllowTcpForwarding yes改为 AllowTcpForwarding no后保存退出
1.打开sshd_config文件
vi /etc/ssh/sshd_config
2.将#PasswordAuthentication yes改为PasswordAuthentication no后保存退出
1.打开sshd_config文件
vi /etc/ssh/sshd_config
2.将#PubkeyAuthentication yes改为PubkeyAuthentication no后保存退出
在Ubuntu18.04系统中,如何进行网络测速?本文将针对此问题进行详细说明。1.首先更新软件列表
sudo apt-get update
2.下载测试脚本
wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
3.修改脚本权限
chmod 755 speedtest.py
将脚本放到系统命令文件中
mv speedtest.py /usr/bin/
4.运行命令
speedtest.py
可以看到测试结果
在ubuntu18.04中如何使程序后台运行呢?本文给出详细说明。
1.后台运行程序
nohup 程序 &
2.查看正在后台运行的程序
jobs -l
3.停止正在后台运行的程序
kill -9 pid
1.打开sshd_config文件
vi /etc/ssh/sshd_config
2.将PermitRootLogin yes 改为 PermitRootLogin no后保存退出
说明:在禁止root用户登录之前,请先确认已存在其他可以ssh登录的账户
在Ubuntu18.04系统中,如何进行关机重启?本文将针对此问题进行说明。
1.shutdown
格式:shutdown -选项 时间
说明:不指定选项和参数,默认表示 1 分钟之后关闭电脑
常用命令示例
# 重新启动操作系统,其中 now 表示现在
$ shutdown -r now
# 立刻关机,其中 now 表示现在
$ shutdown now
# 系统在今天的 20:25 会关机
$ shutdown 20:25
# 系统再过十分钟后自动关机
$ shutdown 10
# 取消之前指定的关机计划
$ shutdown -c
2.poweroff
立刻关机
3.reboot
立刻重启
4.init
ubuntu系统的运行级别分为7个
0 代表系统停机也就是关机状态
1 代表单用户或者系统维护状态
3 代表命令行
5 代表图形界面
6 代表重新启动
因此init 0可以用来关机
而init 6可以用来重启
TypeScript是JavaScript类型的超集,它可以编译成纯JavaScript。那么在ubuntu18.04中如何安装TypeScript呢?本文给出详细说明。
1.首先更新软件列表
sudo apt-get update
2.安装node.js和npm
sudo apt-get install nodejs
sudo apt-get install npm
3.安装typescript
sudo apt-get install node-typescript
4.查看typescript版本
tsc -v
安装完成