AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-197808

Anatol's questions

Martin Hope
Anatol
Asked: 2019-06-19 03:23:20 +0800 CST

Openssl 使用中间证书将 pem 转换为 crt

  • 2

使用 Firefox,很容易将页面使用的 SSL 证书导出为 x509,并将所有中间证书导出为 *.crt。

我需要通过使用 openssl 将 *.pem 文件转换为 *.crt 作为非二进制格式来做同样的事情。

这些是apache当前使用的证书:

SSLCertificateFile /etc/apache2/ssl/cert-start.pem
SSLCertificateKeyFile /etc/apache2/ssl/key-no-pw.pem
SSLCACertificateFile /etc/apache2/ssl/cert-bundle.pem

我可以使用以下方法轻松地将其转换SSLCertificateFile为 crt:

openssl x509  -in cert-start.pem -out cert-start.crt

为了构建带有完整链的crt,我尝试过-chain,-clcerts但没有运气。

包含所有中间证书的正确方法是什么SSLCACertificateFile /etc/apache2/ssl/cert-bundle.pem?

openssl
  • 2 个回答
  • 55075 Views
Martin Hope
Anatol
Asked: 2016-06-04 02:58:27 +0800 CST

libapache2-mod-passenger 更新打破 redmine

  • 0

在 ubuntu 12.04 服务器 redmine 2.5 上进行安全更新后(错误 500)。我们认识到 libapache2-mod-passenger 是从

libapache2-mod-passenger=2.2.11debian-2

至

libapache2-mod-passenger=2.2.11debian-2+deb6u1ubuntu12.04.1

再次降级这个包解决了这个问题。我该怎么做才能在下一次安全更新中不遇到同样的问题?

redmine ubuntu-12.04
  • 1 个回答
  • 53 Views
Martin Hope
Anatol
Asked: 2014-08-13 03:08:11 +0800 CST

穆宁阅读 apache 图

  • 0

我理解/阅读 Munin apache Graph 是否正确,今天午餐时间 (12:00)

  • 9 个客户端访问了 apache +- 50 个进程此时正在运行,负载在 50K / s 左右?

在此处输入图像描述

munin
  • 1 个回答
  • 460 Views
Martin Hope
Anatol
Asked: 2014-07-18 12:21:07 +0800 CST

ubuntu 12.04 合并硬盘分区

  • -1

我有一个安装了 Ubuntu 12.04 的虚拟机。因此硬盘空间不足,我的计划是增加磁盘空间,然后用新创建的分区扩展现有的根逻辑卷。在阅读了很多教程后,我被困住了如何继续。

这就是 df 命令现在给我的:

Filesystem                        1K-blocks    Used Available Use% Mounted on
/dev/mapper/sun--vg-root   3812876 3095764    520096  86% /
udev                                4078956       4   4078952   1% /dev
tmpfs                                817760   39616    778144   5% /run
none                                   5120       0      5120   0% /run/lock
none                                4088788       0   4088788   0% /run/shm
/dev/sda1                            233191   82814    137936  38% /boot

这 sudo fdisk /dev/sda 告诉我关于分区的内容:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758     8386559     3942401    5  Extended
/dev/sda3         8386560    25165823     8389632   8e  Linux LVM
/dev/sda4        25165824    83886079    29360128   83  Linux
/dev/sda5          501760     8386559     3942400   8e  Linux LVM

我做了什么:在 sudo fdisk /dev/sda 之后,我通过在 fdisk 中选择 n 和 p 创建了一个新的主分区。之后我选择了 sda5 之后的第一个扇区。而不是将新分区的类型更改为 Linux LVM。我已经重复了这一步两次,因为我不确定它是否有效。似乎没有。否则,使用率不应为 86%。有人能帮帮我吗?

ubuntu
  • 1 个回答
  • 534 Views
Martin Hope
Anatol
Asked: 2014-07-02 06:11:55 +0800 CST

Redmine 迁移后出现错误 500

  • 0

我已经在Ubuntu 12.04上安装了一个新的Redmine 2.5.1安装,使用 apache2 和乘客遵循以下方法:http ://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step

在那之后我已经

  1. 转储了现有 Redmine 1.1.3.stable 安装的 mysql 数据库,
  2. 将其还原到我的新服务器上的新数据库,
  3. 将附件从旧服务器复制到新服务器到 /usr/share/redmine/files (+ chmod 755)
  4. 告诉 redmine 将新创建的数据库与我在数据库配置中导入的旧票证一起使用。
  5. 将 dir 更改为 /usr/share/redmine 并触发此操作
rake db:migrate RAILS_ENV=production 

rake generate_secret_token

到目前为止,一切都很好。Redmine 可以在浏览器中查看,管理设置可以在 Projects 中更改。

但是,如果我尝试创建新票证或查看旧票证,我会收到错误 500。此外,Redmine 给了我版本 1.1.3,但应该是 2.5.1。看来我可能忘记运行迁移脚本了。

错误 500

找到我创建的错误

  1. /usr/share/redmine/log/production.log
  2. chmod 755 生产日志
  3. 更改了我的 apache2 配置中的错误处理
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogLevel WARN
ErrorLog "/var/log/apache2/redmine-error.log"
CustomLog "/var/log/apache2/redmine-access.log" common

但我在 production.log、redmine-error.log、error.log 中看不到任何错误!?

如何解决错误 500 问题?

更新我处理让日志记录运行。这是日志输出:

    ActiveRecord::StatementInvalid (Mysql::Error: Unknown column 'author' in 'where clause': SELECT * FROM `workflows` WHERE (`workflows`.old_status_id = 1 AND (role_id IN (1) AND tracker_id = 1 AND ((author = 0 AND assignee = 0) OR author = 1))) ):
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/mysql_adapter.rb:324:in `execute'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/mysql_adapter.rb:639:in `select'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:81:in `cache_sql'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'
  /usr/lib/ruby/vendor_ruby/active_record/base.rb:665:in `find_by_sql'
  /usr/lib/ruby/vendor_ruby/active_record/base.rb:1582:in `find_every'
  /usr/lib/ruby/vendor_ruby/active_record/base.rb:619:in `find'
  /usr/lib/ruby/vendor_ruby/active_record/associations/association_collection.rb:60:in `find'
  app/models/issue_status.rb:78:in `find_new_statuses_allowed_to'
  /usr/lib/ruby/vendor_ruby/active_record/associations/association_proxy.rb:215:in `send'
  /usr/lib/ruby/vendor_ruby/active_record/associations/association_proxy.rb:215:in `method_missing'
  app/models/issue.rb:471:in `new_statuses_allowed_to'
  app/controllers/issues_controller.rb:325:in `build_new_issue_from_params'
  /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:178:in `send'
  /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:178:in `evaluate_method'
  /usr/lib/ruby/vendor_ruby/active_support/callbacks.rb:166:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:225:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:629:in `run_before_filters'
  /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:615:in `call_filters'
  /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:610:in `perform_action_without_benchmark'
  /usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  /usr/lib/ruby/vendor_ruby/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  /usr/lib/ruby/vendor_ruby/action_controller/rescue.rb:160:in `perform_action_without_flash'
  /usr/lib/ruby/vendor_ruby/action_controller/flash.rb:151:in `perform_action'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:532:in `send'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:532:in `process_without_filters'
  /usr/lib/ruby/vendor_ruby/action_controller/filters.rb:606:in `process'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:391:in `process'
  /usr/lib/ruby/vendor_ruby/action_controller/base.rb:386:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/routing/route_set.rb:438:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:87:in `dispatch'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:121:in `_call'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:130:in `build_middleware_stack'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:in `call'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:29:in `call'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:9:in `cache'
  /usr/lib/ruby/vendor_ruby/active_record/query_cache.rb:28:in `call'
  /usr/lib/ruby/vendor_ruby/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/string_coercion.rb:25:in `call'
  /usr/lib/ruby/vendor_ruby/rack/head.rb:9:in `call'
  /usr/lib/ruby/vendor_ruby/rack/methodoverride.rb:24:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/params_parser.rb:15:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/session/cookie_store.rb:99:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/failsafe.rb:26:in `call'
  /usr/lib/ruby/vendor_ruby/rack/lock.rb:15:in `call'
  /usr/lib/ruby/vendor_ruby/action_controller/dispatcher.rb:106:in `call'
  /usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in `process_request'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:in `start'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
  /usr/lib/phusion_passenger/passenger-spawn-server:61
redmine
  • 1 个回答
  • 2727 Views
Martin Hope
Anatol
Asked: 2014-07-02 00:56:35 +0800 CST

后缀 - 来自名称的电子邮件标题

  • 0

在安装了后缀的 Ubuntu 12.04 服务器上:如果我从终端发送带有邮件的电子邮件并查看电子邮件标题。

后缀从哪里生成此行的 from 名称:

收到:来自service.example.com (service.example.com. [40.237.188.111])

我看过

  • /etc/邮件名
  • /etc/hosts
  • /etc/主机名
  • /etc/postfix/main.cf
postfix
  • 1 个回答
  • 198 Views
Martin Hope
Anatol
Asked: 2014-06-30 09:15:35 +0800 CST

munin重启monit等服务

  • 0

德语monit wiki页面说:

Die gleichen Funktionen, aber mit einer aufwendigeren grafischen Web-Oberfläche versehen, bietet Munin

翻译

Same functions (as monit) but with a more complex GUI offers Munin

http://wiki.ubuntuusers.de/Monit

我是否错过了什么或者 munin 真的提供了像 monit 一样的功能。如果是这样我怎么能

  • 监控 Apache、Postgresql、ssh 和
  • 如果出现问题,重新启动它们?

通过使用 munin / munin-node

谢谢,

书

munin
  • 1 个回答
  • 269 Views
Martin Hope
Anatol
Asked: 2014-06-27 13:35:38 +0800 CST

ubuntu 12.04 长期监控

  • 0

我有一个运行灯堆栈的 Ubuntu 12.04 服务器。我正在使用资源评分脚本(fe php 脚本生成 excel 文件)。我用谷歌搜索了很多软件,但找不到合适的解决方案。我正在寻找一种可以

  • 作为恶魔跑 2-3 周
  • 易于使用和安装
  • 监控服务器资源(CPU + 内存)
  • 之后给我一个统计数据,哪个文件在什么时间产生了哪个负载

感谢帮助,

书

ubuntu
  • 2 个回答
  • 75 Views
Martin Hope
Anatol
Asked: 2014-03-07 13:08:34 +0800 CST

保持 Ubuntu 12.04 服务器同步

  • 0

我们有两个完全相同的 VM Ubuntu 12.04 服务器。一个用于开发,另一个用作实时服务器。当客户端接受新的开发时,必须通过 ftp(这可能会导致很多混乱)或 rsync 将更改传输到实时服务器。此外,如果有 linux 更新。我们正在对它们进行测试,并在实时服务器上重做这些步骤。

这一切都会导致大量工作,而且似乎不是万无一失的。

保持服务器同步的好方法是什么?您如何保持服务器同步?假设我想要所有 Linux 软件包(没有网络设置 -> 静态 Ips)和 /mnt /home /var/www 之类的目录同步?

谢谢,

书

linux
  • 2 个回答
  • 87 Views
Martin Hope
Anatol
Asked: 2014-03-06 07:31:47 +0800 CST

vSphere - 将虚拟机复制到外部 USB 硬盘驱动器

  • 14

我们在其他地方有一台 ESXi 服务器。我可以使用 vSphere 客户端连接到服务器。

有一个外部 USB 硬盘驱动器插入服务器。

如何将停止的 VM 复制到外部硬盘驱动器?

vmware-vsphere
  • 6 个回答
  • 95134 Views
Martin Hope
Anatol
Asked: 2014-02-17 12:56:58 +0800 CST

vmware vsphere 克隆虚拟机

  • 0

这是我第一次在 mvware esx 环境中克隆 vm ubuntu 12.04 生产服务器。因此,我有点害怕失去视线。服务器不过是一个webserver apache + postgresql 数据库,顺便使用openssh、Nagios for Monitoring 和Amanda Backup。通过 Vmware Data 客户端,我不允许更改 vswitch 上的某些内容,这意味着我必须为 Clone 提供一个新的静态 Ip。

这就是我到目前为止所做的:

  1. 通过数据中心进行克隆
  2. 在克隆时,删除了用于 Amanda Backup 的以太网卡
  3. 在设置中,为上行链路切换以太网卡(以避免服务器与其克隆之间的 IP 冲突)
  4. 检查网络卡的 Mac 地址(Vmaware 在克隆中更改了它们,太棒了!)
  5. 克隆 > 开机(插入网卡)
  6. 更改 /etc/network/interfaces 中的静态 IP
  7. 更改了克隆的主机名

还没有完成(害怕)

  1. 启用克隆服务器的以太网卡,表示授予服务器访问网络的权限

问题:

  • 我错过了什么?在某处更改 fe IP?
  • 在最坏的情况下会发生什么?(由于 IP 冲突,Live Server 失去了网络连接?)

感谢您的帮助,

书

ip
  • 1 个回答
  • 1033 Views
Martin Hope
Anatol
Asked: 2014-02-12 03:21:36 +0800 CST

将 SSL 证书从一台服务器传输到另一台 ubuntu 服务器

  • 0

我们正在与客户合作。服务器(A,example.com)包含来自我们的 ubuntu apache(B,140.120.98.178)的内容。服务器 (A) 已经在使用我们也应该使用的 ssl 证书。问题:是否可以将 fe *.crt 和 *key 文件复制到我们的服务器 fe 到 /etc/apache2/ssl/ 并启用它

a2ensite default-ssl

如果是这样,“通用名称”会发生什么(当您使用 openssl 创建证书时可以定义 fe)会不会是错误的(会有 example.com 我们的 140.120.98.178)?

非常感谢,

书

apache-2.2
  • 1 个回答
  • 242 Views
Martin Hope
Anatol
Asked: 2014-02-04 06:37:48 +0800 CST

来自 ubuntu 12.04 服务器的 synology nas DS213 J rsync 文件

  • 0

我有一个 Synology DS213 J Nas 系统。我正在尝试在没有密码提示的情况下将文件夹从 ubuntu 12.04 网络服务器同步到 nas。因此,我使用 root 帐户通过终端登录了 nas。

创建了 ssh 目录 /root/.ssh

$ mkdir /root/.ssh

用

   $ ssh-keygen

-> 用空的释义

因此 ssh-copy-id 在 Synology nas 上不起作用我手动将 id_rsa.pub 复制到 ubuntu 机器

$ cat id_rsa.pub

将其复制并粘贴到 ubuntu 服务器上

$ ~/.ssh/nas.pub

并将文件“分类”到authorized_keys

$ cat ~/.ssh/nas.pub >> authorized_keys

/etc/ssh/sshd_config 设置为

has RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      %h/.ssh/authorized_keys

不幸的是,如果我正在尝试 rsync,我会被要求提供空的释义和 ubuntu 机器的密码。有助于任何提示,

托尼

ubuntu
  • 1 个回答
  • 1177 Views
Martin Hope
Anatol
Asked: 2013-12-26 06:43:05 +0800 CST

恢复 postgres Dump 给出错误:类型不存在

  • 1

我已经从一台带有 postgresql 8.4 和 postgis 1.5 的旧 Ubuntu 机器上转储了一个数据库。在新的 ubuntu 12.04 上,我还安装了 Postgresql 9.1 和 postgis 1.5。(使用 postgis.sql 和 spatial_ref_sys.sql 创建了 postgis_template)。

当我在新机器上恢复转储时,数据已构建,但我收到 25 条类似这样的错误消息

...    

pg_restore: [archiver (db)] Error from TOC entry 711; 1255 18533 FUNCTION gidx_in(cstring) postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  function public.gidx_in(cstring) does not exist
    Command was: DROP FUNCTION public.gidx_in(cstring);

pg_restore: [archiver (db)] Error from TOC entry 34; 1255 17743 FUNCTION geometry_send(geometry) postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  type "geometry" does not exist
    Command was: DROP FUNCTION public.geometry_send(geometry);

pg_restore: [archiver (db)] Error from TOC entry 33; 1255 17742 FUNCTION geometry_recv(internal) postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  function public.geometry_recv(internal) does not exist
    Command was: DROP FUNCTION public.geometry_recv(internal);

pg_restore: [archiver (db)] Error from TOC entry 31; 1255 17740 FUNCTION geometry_out(geometry) postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  type "geometry" does not exist
    Command was: DROP FUNCTION public.geometry_out(geometry);

pg_restore: [archiver (db)] Error from TOC entry 30; 1255 17739 FUNCTION geometry_in(cstring) postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  function public.geometry_in(cstring) does not exist
    Command was: DROP FUNCTION public.geometry_in(cstring);

pg_restore: [archiver (db)] Error from TOC entry 709; 1255 18529 FUNCTION geography_out(geography) postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  type "geography" does not exist
    Command was: DROP FUNCTION public.geography_out(geography);

任何人都可以解释发生了什么吗?我可以忽略这些错误吗?

谢谢!亲切的问候,

托尼

postgresql
  • 1 个回答
  • 3181 Views
Martin Hope
Anatol
Asked: 2013-12-24 07:41:24 +0800 CST

Apache 2 重启失败

  • 0

圣诞节快乐!

我正在设置一个 Ubuntu 12.04 网络服务器。因此我安装了 Apache2,也安装了 mod_security。我编辑了有关 mod_security 的配置。昨天一切正常。

今天我很想重新启动 Apache,但这失败并出现以下错误:

$ /etc/init.d/apache2 restart

Syntax error on line 2 of /etc/apache2/conf.d/DEADJOE:
Invalid command '***', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
   ...fail!

我检查了 apache 错误日志,但在 syslog 中找不到任何相同的内容。/etc/apache2/conf.d/DEADJOE 的内容是:

*** These modified files were found in JOE when it aborted on Mon Dec 23 14:48:44 2013
*** JOE was aborted because the terminal closed

*** File '(Unnamed)'
/etc/modsecurity/modsecurity.conf
/etc/apache2/mods-available/mod-security.conf
/etc/modsecurity/modsecurity.conf
/var/log/apache2/error.log
/etc/apache2/conf.d/modsecurity.conf
/etc/apache2
security
/etc/modsecurity/modsecurity.conf
/var/log/apache2/error.log
/etc/modsecurity/modsecurity.conf
/var/log/apache2/error.log

谢谢你的帮助!

托尼

apache-2.2
  • 1 个回答
  • 271 Views
Martin Hope
Anatol
Asked: 2013-11-10 03:35:38 +0800 CST

通过 iptables 或 /etc/hosts.allow 限制 ubuntu 12.04 上的 ssh、sftp 访问

  • 0

我试图限制对 ubuntu 服务器的访问,但我仍然不确定该走哪条路。情况:我们想在 ubuntu 12.04 服务器上将 ssh 和 sftp 的访问限制为 4 个没有静态 IP 的客户端。因此每个客户都有一个 dyndns 帐户。服务器将使用共享防火墙,遗憾的是它不能使用 dyndns 帐户作为允许规则。

想法:允许访问共享防火墙中的 ssh 和 sftp,但阻止所有服务器端的 4 个 dyndns 帐户。

但是实现这一目标的最简单方法是什么?

第一个解决方案是在此脚本中使用 iptabels :由 cronjob 运行,它检查 dyndns ips 并使用以下内容更新 iptable 规则:

# All connectsion from address 1.2.3.4 to SSH (port 22)
iptables -A INPUT -p tcp -m state --state NEW --source DYNDNS_IP --dport 22 -j ACCEPT

# Deny all other SSH connections
iptables -A INPUT -p tcp --dport 22 -j DROP

第二种解决方案是通过拒绝主机 fe 进行限制:

# /etc/hosts.allow
sshd: client.dyndns.org

# /etc/hosts.deny
sshd: ALL

但我不确定denyhosts 是否也能够限制ftp 访问。如果是这样,这个解决方案看起来会更容易管理。

感谢每一个想法,

亲切的问候,

托尼

ssh
  • 2 个回答
  • 1013 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve