我想确保传输仅在其运行的服务器连接到 VPN 时发送/接收流量。
我发现了这个类似的问题,但我不想强制所有流量通过 VPN,而且我无法找到有关如何从命令行使用 firestarter 的良好指南。
相反,我正在考虑使用 ufw,但我几乎没有使用防火墙的经验,我希望社区可以帮助我。
我的一个想法是强制传输使用特定端口,比如 33442,然后只允许来自 VPN 服务器的 IP 地址的流量进出该端口。我查看了 Ubuntu 服务器指南,我认为可以这样做:
sudo ufw enable
sudo ufw deny port tcp from localhost to any port 33442
sudo ufa allow port tcp from localhost to VPNIP port 33442
sudo ufw deny port udp from localhost to any port 33442
sudo ufa allow port udp from localhost to VPNIP port 33442
Run Code Online (Sandbox Code Playgroud)
这个逻辑是否成立?你会怎么做?我将用于 VPNIP、VPN 服务器的公共 IP,还是应该指定 VPN 将我连接到的本地子网范围?
谢谢你的帮助!
sudo apt-get update
sudo apt-get upgrade
Run Code Online (Sandbox Code Playgroud)
ifconfig
sudo nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.150
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.1.255
gateway 192.168.2.1
safe
Run Code Online (Sandbox Code Playgroud)sudo nano /etc/resolv.conf
Do not edit this file by hand --your changes will be overwritten
# I add this
nameserver 8.8.8.8
nameserver 8.8.4.4
Run Code Online (Sandbox Code Playgroud)sudo apt-get remove dhcp-client
sudo /etc/init.d/networking restart
*Running /etc/init.d/networking restart is deprecated because it may
not enable again some interfaces
*Reconfiguring network interfaces...
ssh stop/waiting
ssh start/running,process 1438
Run Code Online (Sandbox Code Playgroud)错误在哪里?我不懒。我用谷歌搜索了 3 …
我一直在使用 xclip 复制 bash 命令的输出,如下所示:
pwd | tr -d "\n" | xclip -selection c
Run Code Online (Sandbox Code Playgroud)
这样我就可以将输出粘贴到另一个终端会话中。
我试图在我的无头服务器(ubuntu 13.04)上使用它,该服务器在没有 x 的情况下启动。它不适用于以下错误:
Error: Can't open display: (null)
Run Code Online (Sandbox Code Playgroud)
有没有解决的办法。我意识到看到程序被称为 xclip 它可能是不可能的。
尝试安装最新的 PHP5 软件包,因此我添加了我需要的 repo ( sudo add-apt-repository ppa:ondrej/php5 ),结果如下:
Traceback (most recent call last):
File "/usr/lib/python3.2/threading.py", line 740, in _bootstrap_inner
self.run()
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 141, in run
self.add_ppa_signing_key(self.ppa_path)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 234, in add_ppa_signing_key
tmp_export_keyring, signing_key_fingerprint, tmp_keyring_dir):
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 186, in _verify_fingerprint
got_fingerprints = self._get_fingerprints(keyring, keyring_dir)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 178, in _get_fingerprints
output = subprocess.check_output(cmd, universal_newlines=True)
File "/usr/lib/python3.2/subprocess.py", line 516, in check_output
output, unused_err = process.communicate()
File "/usr/lib/python3.2/subprocess.py", line 811, in communicate
stdout = _eintr_retry_call(self.stdout.read)
File "/usr/lib/python3.2/subprocess.py", line 456, …Run Code Online (Sandbox Code Playgroud) 我正在管理几台用于核心服务(NTP、DNS 等)的服务器,我突然发现其中一台服务器似乎保留了 3 个最新内核,而不是其他服务器上的 2 个:
nul@quark:~$ sudo apt-get autoremove --purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
nul@quark:~$ dpkg -l |grep linux-image
ii linux-image-3.13.0-51-generic 3.13.0-51.84 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii linux-image-3.13.0-52-generic 3.13.0-52.85 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii linux-image-3.16.0-37-generic 3.16.0-37.49~14.04.1 amd64 Linux kernel image for version 3.16.0 on …Run Code Online (Sandbox Code Playgroud) 我在 ubuntu15.04 中安装或删除部分安装的 mysql-server-5.6 时遇到问题。我得到的错误是
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mysql-server-5.6
The following packages will be upgraded:
mysql-server-5.6
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
22 not fully installed or removed.
Need to get 0 B/5,501 kB of archives.
After this operation, 50.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] …Run Code Online (Sandbox Code Playgroud) 我有 Ubuntu Server 11.04,但它是无头的(没有监视器)。我希望能够访问它的唯一方法是通过 SSH 远程访问。但是,有时,比如断电后,当服务器重新启动时,它会卡在 Grub 启动菜单上,并且不会倒计时。它会挂在那里等我选择第一个启动项。这意味着我必须去那里插入显示器和键盘。
但我不能远程做到这一点。无论断电还是其他原因,如何强制它继续引导到引导条目 1(默认)?
我正在设置多机备份计划,我希望在每台机器上使用一个名为“backup”的用户作为备份目的地。
我的问题是,我的机器上已经有一个名为“备份”的用户。
它有什么用,我可以为了自己的目的劫持它吗?
root@frodo:~# useradd backup
useradd: user 'backup' already exists
Run Code Online (Sandbox Code Playgroud) 我想配置我的 Ubuntu 12.04 服务器以将其时钟与特定的 NTP 服务器同步。在哪里设置这个?
我byobu在我的家庭服务器上运行,今天我注意到了这一点 - 它是什么?
它是 64 位 11.10 服务器上的 byobu 通知/状态栏的一部分。
