在 GCP 中启动一些小型虚拟机,并认为我会给 Ubuntu 20.04 LTS 最小的尝试。执行“apt update; apt upgrade”后,我可以安装像 Apache 这样的软件包,但使用 PIP 的运气为零:
root@ubuntu-rr58:/home/me# apt install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pip
Run Code Online (Sandbox Code Playgroud)
我已经验证了 Universe、Multiverse 和 Restricted 存储库可用:
root@ubuntu-rr58:~# grep ^deb /etc/apt/sources.list
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal main restricted
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-updates main restricted
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal universe
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-updates universe
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-updates multiverse
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu focal-security …Run Code Online (Sandbox Code Playgroud) 我已经在 ubuntu 16.04 上安装了 ntp,但是当我运行时timedatectl它不显示 NTP。它显示systemd-timesyncd在输出中。
我运行了命令sudo systemctl disable systemd-timesyncd; sudo systemctl stop systemd-timesyncd; sudo systemctl enable ntp;
如何为 timedatectl 设置 ntp?
我什至尝试过,timedatectl set-ntp true但它仍然没有显示在timedatectl输出下。
root@host001:~# timedatectl
Local time: Fri 2020-05-08 16:00:59 UTC
Universal time: Fri 2020-05-08 16:00:59 UTC
RTC time: Fri 2020-05-08 16:00:59
Time zone: UTC (UTC, +0000)
System clock synchronized: no
systemd-timesyncd.service active: no
RTC in local TZ: no
Run Code Online (Sandbox Code Playgroud)
我期待如下输出(如其他帖子中所示),其中显示 NTP 而不是systemd-timesyncd
Local time: Fri 2020-05-08 16:00:59 UTC …Run Code Online (Sandbox Code Playgroud) 我最近在我的 2009 Mac pro 4,1(闪存到 5,1)的硬盘上安装了 Ubuntu 20.04。此时我已擦除并重新安装了 3 次。三次安装都顺利,但第一次启动时启动就挂起
[ OK ] Reached target Cloud-init target
我读了一些论坛,提到了这个问题,然后简单地重新启动了系统。
任何后续的启动都会挂起:
Ubuntu 20.04 LTS *********-server tty1
*********-server login: [ 32.083683] cloud-init[891]: Cloud-init v. 20.1-10-g71af48df-0ubuntu5 running 'modules:config' at Fri, 08 May 2020 20:58:20 +0000. Up 31.93 seconds.
[ 32.767663] cloud-init[898]: Cloud-init v. 20.1-10-g71af48df-0ubuntu5 running 'modules:final' at Fri, 08 May 2020 20:58:21 +0000. Up 32.59 seconds.
[ 32.767850] cloud-init[898]: Cloud-init v. 20.1-10-g71af48df-0ubuntu5 finished at Fri, 08 May 2020 20:58:21 +0000. Datasource DataSourceNoCloud [seed=/var/lib/cloud/seed/ncloud-net] [dsmode=net]. …Run Code Online (Sandbox Code Playgroud) 我想托管一个服务,然后在通过特定域访问该服务时使用特定代理连接到它。
就像这里显示的那样:
| # User make a request to s2.example.com
|__ s2.example.com <-- This is my VPS that runs debian sid, nginx and some websites hosted on example.com
|
|__ nginx receive request, and use 127.0.0.1:9050 as socks5 proxy, and send request to elpmaxe.onion
|
|__ 127.0.0.1:9050 receive request, and redirect it to target elpmaxe.onion
|
|__ elpmaxe.onion receive request, and send response
Run Code Online (Sandbox Code Playgroud)
// 我知道这会导致连接延迟,但这不是一个大问题。
为了解决我的问题,我想做这样的事情,但我只是不知道如何在执行 proxy_pass 时使用socks5。
location / {
# using socks5 proxy on 127.0.0.1:9050
proxy_pass http://elpmaxe.onion/;
}
Run Code Online (Sandbox Code Playgroud) 我想在运行于不同端口的同一虚拟机中安装许多带有 php 服务器的 Apache,因为我想将 N 个不同的网站托管到同一个虚拟机中,以避免创建 N 个虚拟机来托管 N 个网站。
是否有任何简单的 DNS 配置可以将不同的域重定向到不同端口中的相同 IP?
例子:
在 systemd(UbuntuLinux 18.04 bionic 上的 v237)中,我可以创建一个服务文件(用于A.service),并指定另一个服务Requisite=B.service。这意味着如果我尝试启动A.service但B.service尚未运行,则 A.service 将不会启动。这是 的弱版本,当我尝试启动时Requires它将启动。B.serviceA.service
有相反的吗?我可以说\xe2\x80\x9c如果B.service正在运行,那么就不要启动这个服务\xe2\x80\x9d / \xe2\x80\x9c如果B.service正在运行,那么A.service无法启动\xe2\ x80\x9d?
\n\n文档说如果我这样做Conflicts=B.service,那么启动A将停止 B 然后启动 A。但我不希望 B 停止,我只是希望 A 无法启动。我想要的东西就是Conflicts这样Requisite的Requires。
我可能可以将 更改ExecStart为会失败的 shell 命令systemctl is-active B.service或某种 hack。有没有合适的解决办法呢?
我需要将 Windows 机器用于只能在 Windows 上运行的程序。我在 Azure 上设置了一个 Windows 10 虚拟机。在 Azure 门户的虚拟机下Connection,我看到了 RDP 的详细信息,它可以与应用商店中的 Microsoft 远程桌面应用一起使用。
我也想用SSH连接。单击 RDP 旁边的项目,我看到:
Ensure you have read-only access to the private key.
chmod 400 <name>.pem
Run Code Online (Sandbox Code Playgroud)
没有任何指示在哪里下载或上传该密钥。
我在下面在Azure门户打开22端口这些方向,我也跟随的PowerShell的部分安装OpenSSH服务器这些方向,包括启动服务:
> Set-Service -Name sshd -StartupType 'Automatic'
> Get-NetFirewallRule -Name *ssh*
Name : OpenSSH-Server-In-TCP
DisplayName : OpenSSH SSH Server (sshd)
Description : Inbound rule for OpenSSH SSH Server (sshd)
DisplayGroup : OpenSSH Server
Group : OpenSSH Server
Enabled : True
Run Code Online (Sandbox Code Playgroud)
在我的本地机器上,SSH 超时到虚拟机的公共 …
我想我已经删除了LVM分区。我在 vmware 中扩展了数据存储(70 GB 到 90 GB),然后运行echo 1> /sys/class/block/sdb/device/rescan.
之后我就跑了fdisk /dev/sdb。它显示我的 sdb 是 90 GB,但有此警告:
The old LVM2_member signature will be removed by a write command.
我确实输入了 w,我认为这是一个坏主意。现在这些命令都没有显示任何内容:lvs, vgs, pvs
我看到blkid我的 sdb UUID 已更改:
/dev/sda1: UUID="b96e5429-d28e-4102-9085-4f303642a26e" TYPE="ext4" PARTUUID="0ab90198-01"
/dev/mapper/vg00-vol_db: UUID="4ed1927e-620a-4bf9-b656-c208f31e6ea3" TYPE="ext4"
/dev/sdb: PTUUID="d6c28699" PTTYPE="dos"
Run Code Online (Sandbox Code Playgroud)
我运行的vgcfgrestore vg00 --test -f vg00_00001-2029869851.vg是今天更改之前的最后一个文件。(这是两个月前我创建LVM时的)但是它返回了
TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
Couldn't find device with uuid 4deOKh-FeJz-8JqG-SAyX-KviL-UGu4-PtJ138.
Cannot restore Volume …Run Code Online (Sandbox Code Playgroud) 这个问题出现在 CentOS 7 的 kvm/qemu 管理程序上,我们在其中托管多个虚拟机。
磁盘 /dev/sda(1918.2 GB) 是 raid6 LSI MEGARAID。
[root@mia3 ~]# fdisk -l
Disk /dev/sda: 1918.2 GB, 1918239768576 bytes, 3746562048 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x51549cd4
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 135243775 67108864 82 Linux swap / …Run Code Online (Sandbox Code Playgroud) 将我的工作站升级到 Ubuntu 20.04 LTS 后,我无法连接到在 CentOS 7 服务器上运行的 MySQL 5.7.27。我使用命令进行连接mysql -h <server_ip> -u <user_name> -p,输入密码后出现错误 2026:
ERROR 2026 (HY000): SSL connection error: error:1425F102:SSL
routines:ssl_choose_client_version:unsupported protocol
Run Code Online (Sandbox Code Playgroud)
我还尝试使用 mysqldump 获取数据库数据,但最终出现了类似的错误。我想可能在工作站升级后 mysql 客户端不支持旧协议,所以我使用 ssh 登录服务器,从服务器的 shell 访问 mysql 并查看支持哪些协议
mysql> SHOW GLOBAL VARIABLES LIKE 'tls_version';
+---------------+---------------+
| Variable_name | Value |
+---------------+---------------+
| tls_version | TLSv1,TLSv1.1 |
+---------------+---------------+
1 row in set (0,00 sec)
Run Code Online (Sandbox Code Playgroud)
有了这些信息,我尝试再次从工作站连接,这次指定了 TLS 版本
mysql -h <server_ip> --tls-version=TLSv1.1 -u <user_name> -p
mysql -h <server_ip> --tls-version=TLSv1 -u <user_name> -p …Run Code Online (Sandbox Code Playgroud) linux ×3
ubuntu-20.04 ×3
lvm ×2
ubuntu ×2
apache2 ×1
apt ×1
azure ×1
boot ×1
centos7 ×1
cloud-init ×1
dns-hosting ×1
job-control ×1
mysql ×1
networking ×1
nginx ×1
ntp ×1
pip ×1
python ×1
socks ×1
ssh ×1
ssl ×1
systemd ×1