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-225844

MohammedSimba's questions

Martin Hope
MohammedSimba
Asked: 2020-04-09 01:02:41 +0800 CST

Fail2ban 在服务重启后不会保留手动禁止的 IP

  • 0

刚刚使用此线程在 Ubuntu 14.04 上从 f2b v0.9.6 升级到 v0.10.5 ,并且根据我从以前版本复制的旧监狱,它正常禁止。

但是当我重新启动服务时,它只保留被配置的启用监狱禁止的 IP。fail2ban-client set sshd banip 1.2.3.4当我重新启动时,所有手动禁止的 IP都消失了。这不是我使用的旧版本的正常行为。

请问有什么帮助吗?

更新:刚刚在 2 台 Ubuntu 16.04 服务器上测试(作为全新安装和升级)f2b,它的行为相同。似乎与 Ubuntu 版本无关

iptables firewall 16.04 14.04 fail2ban
  • 1 个回答
  • 384 Views
Martin Hope
MohammedSimba
Asked: 2018-05-11 05:46:57 +0800 CST

SSH 私钥不会在启动时自动加载

  • 0

每当我启动“Ubuntu 16.04”PC 时,我总是需要手动运行ssh-add以添加默认私钥路径~/.ssh/id_rsa,

我将它添加到.ssh/config文件中:

IdentityFile /home/me/.ssh/id_rsa

仍然没有工作,当我尝试 ssh 时,它给出以下内容并要求输入密码:

$ ssh [email protected] -vvv
OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /home/me/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "xx.xx.xx.xx" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to xx.xx.xx.xx [xx.xx.xx.xx] port 22.
debug1: Connection established.
debug1: identity file /home/me/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.10
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.10 pat OpenSSH_5* compat 0x0c000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to xx.xx.xx.xx:22 as 'root'
debug3: hostkeys_foreach: reading file "/home/me/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/me/.ssh/known_hosts:10
debug3: load_hostkeys: loaded 1 keys from xx.xx.xx.xx
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,[email protected],zlib
debug2: compression stoc: none,[email protected],zlib
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: MACs ctos: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: MACs stoc: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: compression ctos: none,[email protected]
debug2: compression stoc: none,[email protected]
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes128-ctr MAC: [email protected] compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: [email protected] compression: none
debug3: send packet: type 30
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:m4LxapdqnUrO1cpFpX6YpxXR8bPTsfvW73fhgpb0+8Y
debug3: hostkeys_foreach: reading file "/home/me/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/me/.ssh/known_hosts:10
debug3: load_hostkeys: loaded 1 keys from xx.xx.xx.xx
debug1: Host 'xx.xx.xx.xx' is known and matches the ECDSA host key.
debug1: Found key in /home/me/.ssh/known_hosts:10
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug2: set_newkeys: mode 0
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS received
debug2: key: /home/me/.ssh/id_rsa (0x56130221f5c0), explicit, agent
debug3: send packet: type 5
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/me/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
[email protected]'s password:
ssh 16.04
  • 1 个回答
  • 922 Views
Martin Hope
MohammedSimba
Asked: 2017-06-24 18:56:57 +0800 CST

Nginx 下载文件,不显示内容

  • 6

在我的网站上,我有一些验证文件需要放入没有扩展名的文档根目录中,只是“验证文件”,

但是当我尝试从浏览器打开它时,它会下载而不是打开,所有其他带有(.txt)扩展名的文件都可以正常打开,

我的 nginx (1.12) 配置:

server {
listen 80;
listen 443 ssl;

root /var/www/website;
error_log /var/log/nginx/website-error.log;
access_log /var/log/nginx/website-access.log;

index index.php index.html index.htm index.nginx-debian.html;

server_name website.com;
ssl_certificate /etc/ssl/website/nginx_bundle.crt;
ssl_certificate_key /etc/ssl/website/website.key;

location / {
    index index.php index.html;
    try_files $uri $uri/ =404 /index.php?q=$uri&$args;
}

# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
    root /var/www/website;

    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /var/www/website/$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_script_name;

}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
    deny all;
}
14.04
  • 1 个回答
  • 21714 Views
Martin Hope
MohammedSimba
Asked: 2017-02-16 03:19:07 +0800 CST

apt-get:无法安装或升级任何软件包 [重复]

  • 2
这个问题在这里已经有了答案:
我的 /boot 分区达到 100%,现在我无法升级。无法移除旧内核以腾出空间 18 个答案
如何在 /boot 中释放更多空间? (23 个回答)
5年前关闭。

我正在使用 Ubuntu 12.04。我无法安装或升级我拥有的任何软件包:

apt-get install traceroute
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-generic : Depends: linux-headers-generic (= 3.2.0.76.90) but 3.2.0.77.91 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

如果我尝试-f,我被告知/boot已满:

apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.2.0-74 linux-image-3.2.0-74-generic linux-headers-3.2.0-74-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-generic linux-headers-generic linux-image-3.2.0-121-generic linux-image-generic
Suggested packages:
  fdutils linux-doc-3.2.0 linux-source-3.2.0 linux-tools
The following NEW packages will be installed:
  linux-image-3.2.0-121-generic
The following packages will be upgraded:
  linux-generic linux-headers-generic linux-image-generic
3 upgraded, 1 newly installed, 0 to remove and 203 not upgraded.
10 not fully installed or removed.
Need to get 0 B/38.8 MB of archives.
After this operation, 151 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
........
dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-121-generic_3.2.0-121.164_amd64.deb (--unpack):
 failed in write on buffer copy for backend dpkg-deb during `./boot/vmlinuz-3.2.0-121-generic': No space left on device
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-121-generic /boot/vmlinuz-3.2.0-121-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-121-generic /boot/vmlinuz-3.2.0-121-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.2.0-121-generic_3.2.0-121.164_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我的/boot尺码:

/dev/sda1        92M   85M  1.9M  98% /boot

ls -ll
total 76775
-rw------- 1 root root  2884358 Apr 11  2012 System.map-3.2.0-23-generic
-rw------- 1 root root  2897962 Dec  9  2014 System.map-3.2.0-74-generic
-rw------- 1 root root  2898003 Dec 16  2014 System.map-3.2.0-75-generic
-rw------- 1 root root  2898466 Jan 13  2015 System.map-3.2.0-76-generic
-rw-r--r-- 1 root root   791023 Apr 11  2012 abi-3.2.0-23-generic
-rw-r--r-- 1 root root   796535 Dec  9  2014 abi-3.2.0-74-generic
-rw-r--r-- 1 root root   796535 Dec 16  2014 abi-3.2.0-75-generic
-rw-r--r-- 1 root root   796597 Jan 13  2015 abi-3.2.0-76-generic
-rw-r--r-- 1 root root   140279 Apr 11  2012 config-3.2.0-23-generic
-rw-r--r-- 1 root root   140790 Dec  9  2014 config-3.2.0-74-generic
-rw-r--r-- 1 root root   140790 Dec 16  2014 config-3.2.0-75-generic
-rw-r--r-- 1 root root   140790 Jan 13  2015 config-3.2.0-76-generic
drwxr-xr-x 3 root root     7168 Feb  1  2015 grub
-rw-r--r-- 1 root root 14177627 Apr  9  2014 initrd.img-3.2.0-23-generic
-rw-r--r-- 1 root root 14232258 Dec 11  2014 initrd.img-3.2.0-74-generic
-rw-r--r-- 1 root root 14233553 Feb  1  2015 initrd.img-3.2.0-75-generic
drwx------ 2 root root    12288 Nov 21  2013 lost+found
-rw-r--r-- 1 root root   176764 Nov 27  2011 memtest86+.bin
-rw-r--r-- 1 root root   178944 Nov 27  2011 memtest86+_multiboot.bin
-rw------- 1 root root  4965840 Apr 11  2012 vmlinuz-3.2.0-23-generic
-rw------- 1 root root  4990768 Dec  9  2014 vmlinuz-3.2.0-74-generic
-rw------- 1 root root  4991088 Dec 16  2014 vmlinuz-3.2.0-75-generic
-rw------- 1 root root  4991856 Jan 13  2015 vmlinuz-3.2.0-76-generic

我在这里尝试了解决方案和其他清除旧内核解决方案,但出现以下错误:

$ uname -r
3.2.0-75-generic

$dpkg --list 'linux-image*' | grep ^ii
ii  linux-image-3.2.0-23-generic     3.2.0-23.36                         Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-74-generic     3.2.0-74.109                        Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-75-generic     3.2.0-75.110                        Linux kernel image for version 3.2.0 on 64 bit x86 SMP

$ apt-get remove linux-image-3.2.0-74-generic 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-generic : Depends: linux-headers-generic (= 3.2.0.76.90) but 3.2.0.77.91 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

请问有什么帮助吗?

编辑:

我在这里尝试了解决方案并手动删除了旧内核,但现在我遇到了一个不同的依赖问题:

apt-get install -f
......

Generating grub.cfg ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.2.0-121-generic
Found initrd image: /boot/initrd.img-3.2.0-121-generic
Found linux image: /boot/vmlinuz-3.2.0-76-generic
Found initrd image: /boot/initrd.img-3.2.0-76-generic
Found linux image: /boot/vmlinuz-3.2.0-75-generic
Found initrd image: /boot/initrd.img-3.2.0-75-generic
Found memtest86+ image: /memtest86+.bin
done
Setting up linux-image-generic (3.2.0.121.136) ...
Setting up linux-headers-generic (3.2.0.121.136) ...
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.2.0.76.90); however:
  Version of linux-image-generic on system is 3.2.0.121.136.
 linux-generic depends on linux-headers-generic (= 3.2.0.76.90); however:
  Version of linux-headers-generic on system is 3.2.0.121.136.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

并且当前内核仍然是“3.2.0-75-generic”

12.04
  • 1 个回答
  • 732 Views
Martin Hope
MohammedSimba
Asked: 2016-12-23 09:28:38 +0800 CST

升级到 ubuntu 16.04 后无法打开 VMware

  • 0

我有 Ubuntu 14.10 和 vmware 11,在我通过所有版本将我的 Ubuntu 升级到 16.04 LTS 并且一切正常没有错误之后,当我打开我的 vmware 给我时:

在此处输入图像描述

然后当我点击安装它说:

在此处输入图像描述

日志文件内容太长,这里是失败的行数:

2016-12-22T19:13:35.295+02:00| vthread-4| I120: [msg.dictionary.load.openFailed] Cannot open file "/usr/lib/vmware/settings": No such file or directory.
2016-12-22T19:13:35.295+02:00| vthread-4| I120: [msg.dictionary.load.openFailed] Cannot open file "/root/.vmware/config": No such file or directory.
2016-12-22T19:13:35.296+02:00| vthread-4| I120: [msg.dictionary.load.openFailed] Cannot open file "/root/.vmware/preferences": No such file or directory.
2016-12-22T19:13:35.296+02:00| vthread-4| I120: PREF Failed to load user preferences.
2016-12-22T19:13:35.373+02:00| vthread-4| I120: Failed to find /lib/modules/4.4.0-57-generic/build/include/linux/version.h
2016-12-22T19:13:35.611+02:00| vthread-4| I120: Failed to find /lib/modules/4.4.0-57-generic/build/include/linux/version.h
2016-12-22T19:13:35.802+02:00| vthread-4| I120: Failed to find /lib/modules/4.4.0-57-generic/build/include/linux/version.h
2016-12-22T19:13:35.819+02:00| vthread-4| I120: Failed to find /lib/modules/4.4.0-57-generic/build/include/linux/version.h
2016-12-22T19:13:35.827+02:00| vthread-4| I120: Failed to find /lib/modules/4.4.0-57-generic/build/include/linux/version.h
2016-12-22T19:13:35.834+02:00| vthread-4| I120: Failed to find /lib/modules/4.4.0-57-generic/build/include/linux/version.h
2016-12-22T19:13:38.879+02:00| vthread-4| W110: Failed to build vmmon.  Failed to execute the build command.
2016-12-22T19:13:40.623+02:00| vthread-4| W110: Failed to build vmnet.  Failed to execute the build command.
16.04
  • 1 个回答
  • 524 Views
Martin Hope
MohammedSimba
Asked: 2016-11-21 07:33:15 +0800 CST

AWK 语法错误:文件意外结束

  • 0

我正在以 sudo 用户的身份制作一个脚本,该脚本向我发送服务器的 CPU 使用情况,并将另一个脚本的结果邮寄给我,

sudo sh -c '{
x=`ps aux | sort -nrk 3,3 | tr -s " " | cut -d" " -f 3,11- |awk '\'BEGIN { OFS = " " } { $1 = $1"%"; print }'\'`
/opt/fetch_script.sh $x
}| mailx [email protected]'

但它仍然给了我使用 AWK 的错误原因:

awk: 0: unexpected character '\'
aux: -c: line 1: syntax error: unexpected end of file

请问有什么帮助吗?

bash
  • 1 个回答
  • 837 Views
Martin Hope
MohammedSimba
Asked: 2016-04-12 02:16:10 +0800 CST

apt-get 更新失败

  • 0

刚刚在我拥有的服务器上安装了服务器 14.04 LTS,但每次我尝试使用“ apt-get update”它都会失败并输出:

....    
    Reading package lists... Error!
    E: Encountered a section with no Package: header
    E: Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty_universe_i18n_Translation-en
    E: The package lists or status file could not be parsed or opened.

我也多次尝试该解决方案:

rm /var/lib/apt/lists/* -vf && apt-get update

我得到了同样的错误:

.....
Get:67 http://us.archive.ubuntu.com trusty/multiverse Translation-en [102 kB]                                                                  
Get:68 http://us.archive.ubuntu.com trusty/restricted Translation-en [3457 B]                                                                  
Get:69 http://us.archive.ubuntu.com trusty/universe Translation-en [4089 kB]                                                                   
Fetched 32.7 MB in 3min 43s (146 kB/s)                                                                                                         
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty_universe_i18n_Translation-en
E: The package lists or status file could not be parsed or opened.

有任何想法吗?

编辑

apt-get install -f
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_trusty_universe_i18n_Translation-en
E: The package lists or status file could not be parsed or opened.
14.04
  • 3 个回答
  • 2687 Views
Martin Hope
MohammedSimba
Asked: 2016-02-17 06:09:12 +0800 CST

通过 2 个脚本在远程服务器上执行命令

  • 1

目前我正在使用SSHPass脚本连接到远程服务器:

sshpass -p PASSWORD ssh -o StrictHostKeyChecking=no [email protected]

并远程执行任何命令,我使用:

sshpass -p PASSWORD ssh -o StrictHostKeyChecking=no [email protected] "COMMAND"

我打算将一个脚本 ( ) 中的连接步骤和另一个脚本 ( conn.sh) 中的命令分开cmd.sh。

我试过这样:

命令.sh:

#!/bin/bash
ls -ltr

conn.sh:

#!/bin/bash    
sshpass -p PASSWORD ssh -o StrictHostKeyChecking=no [email protected] "$1"

并在给两个脚本“chmod a+x”后执行:

./conn.sh cmd.sh

但它给了我错误:

cmd.sh: command not found

我什至试图$1用路径替换cmd.sh,但它给了我这个错误:

sh: /home/myhome/cmd.sh: No such file or directory
bash
  • 1 个回答
  • 7785 Views
Martin Hope
MohammedSimba
Asked: 2016-02-02 13:12:56 +0800 CST

圆立方登录连接到存储服务器失败

  • 1

我有多个域在我的邮件服务器上工作,并且都正常工作,

我通常在 mysql 邮件数据库上配置新邮件域“newdomain.ae”,创建新用户,在服务器上创建收件箱,

但是当我尝试在圆形立方体上的新邮件上登录我的帐户时,我收到错误“登录到存储服务器的连接失败”

圆形立方体的日志是:

[01-Feb-2016 23:00:01 +0200]: IMAP Error: Login failed for [email protected] from 2.2.2.2. Could not connect to newdomain.ae:143: Connection refused in /var/www/webmail/program/lib/Roundcube/rcube_imap.php on line 184 (POST /mail/?_task=login&_action=login)

注意:应用程序服务器托管在域“newdomain.ae”下的另一台不同的服务器上

12.04
  • 1 个回答
  • 14176 Views
Martin Hope
MohammedSimba
Asked: 2016-01-13 02:05:13 +0800 CST

从 https 域重定向到另一个 https 域

  • 0

我如何将 apache 从一个“ https://domain1.com”重定向到“ https://www.domain2.com”

我尝试如下:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName domain1.com
        ServerAlias www.domain1.com

        DocumentRoot /var/www/domain1

        Redirect permanent /  https://www.domain2.com
......
</VirtualHost>
<VirtualHost 2.2.2.2:443>
        ServerAdmin webmaster@localhost
        ServerName domain1.com
        ServerAlias www.domain1.com

        DocumentRoot /var/www/domain1

        Redirect permanent /  https://www.domain2.com
.....
</VirtualHost>

但它只在“http”的情况下重定向,如“ http://domain1.com”转到“ https://www.domain2.com”,在“”的情况下不起作用https://domain1.com?!

server
  • 1 个回答
  • 5461 Views
Martin Hope
MohammedSimba
Asked: 2015-11-04 05:51:24 +0800 CST

创建2个相同IP的https虚拟主机

  • 2

我有域“domain1.com”,它使用 ip“1.1.1.1”并配置为:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName domain1.com
.......
</VirtualHost>
<VirtualHost 1.1.1.1:443>
        ServerAdmin webmaster@localhost
        ServerName domain1.com
.......
</VirtualHost>

我尝试添加使用相同 IP“domain2.com”的新域名

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName domain2.com
.......
</VirtualHost>
<VirtualHost 1.1.1.1:443>
        ServerAdmin webmaster@localhost
        ServerName domain2.com
.......
</VirtualHost>

但是当我重新启动 apache 时,它​​说:

[warn] VirtualHost 1.1.1.1:443 overlaps with VirtualHost 1.1.1.1:443, the first has precedence, perhaps you need a NameVirtualHost directive

当我尝试打开其中任何一个时,第一个域证书显示好像没有 SSL,第二个域没问题。

12.04
  • 1 个回答
  • 1497 Views
Martin Hope
MohammedSimba
Asked: 2015-10-08 01:36:09 +0800 CST

从 CD Ubuntu 14.04 LTS 启动

  • -1

我在 vmware 上安装了 Ubuntu 服务器 14.04 LTS(没有 LVM),我想扩展根分区磁盘空间,所以我尝试先从 CD 启动,我尝试了两种方法:- 尝试从我使用的 iso 启动安装服务器。- 尝试从 DVD PC 驱动器从真正的 DVD 启动,

但是在这两个试验中,我都找不到“尝试 ubuntu”选项,它总是显示安装列表

在此处输入图像描述

14.04
  • 1 个回答
  • 735 Views
Martin Hope
MohammedSimba
Asked: 2015-10-01 04:23:58 +0800 CST

phpmyadmin 停止工作 (1045)

  • -1

我通常在 phpmyadmin 上工作,但今天出于某种原因,每次我尝试使用任何用户“甚至是 root 用户”登录时,我都会收到以下错误

#1045 Cannot log in to the MySQL server

我检查了mysql在服务器上正常运行,我可以正常使用命令行与所有用户登录。

apache或者mysql中都没有错误日志!

有什么建议吗?

12.04
  • 1 个回答
  • 327 Views
Martin Hope
MohammedSimba
Asked: 2015-07-17 00:22:48 +0800 CST

mysql重启后没有启动

  • 3

在我重新启动我的服务器后,除了“mysql”之外的一切都正常启动,我尝试手动启动它“ /etc/init.d/mysql restart”或使用“ service mysql restart”,它失败了

在日志文件中它说:

Jul 16 08:13:38 localhost /etc/init.d/mysql[18136]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jul 16 08:13:38 localhost /etc/init.d/mysql[18136]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

我检查了那个路径,但我没有找到那个套接字文件,请指教?

编辑:

root@myserver:/var/log# service mysql restart
 * Stopping MySQL database server mysqld                   [ OK ] 
 * Starting MySQL database server mysqld                   [fail]
server
  • 3 个回答
  • 8202 Views
Martin Hope
MohammedSimba
Asked: 2015-07-07 02:23:55 +0800 CST

邮件服务器内存缓冲区错误

  • 2

有时,我的邮件服务器会停止发送任何新邮件,而且我每次都会找到错误日志,

Jun 22 23:10:18 myserver saslauthd[3967]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:18 myserver saslauthd[3971]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:19 myserver saslauthd[3972]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:19 myserver saslauthd[3968]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:20 myserver saslauthd[3969]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:20 myserver saslauthd[3967]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:21 myserver saslauthd[3971]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:21 myserver saslauthd[3972]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error
Jun 22 23:10:22 myserver saslauthd[3971]: DEBUG: auth_pam: pam_authenticate failed: Memory buffer error

每次我必须重新启动我的服务器才能再次正常工作

我也总是从未知 IP 中找到以下重复错误日志(我不确定它是否相关):

Jun 21 06:48:43 myserver sshd[1687]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=************  user=root
Jun 21 06:48:45 myserver sshd[1708]: Failed password for root from ######## port 60021 ssh2
Jun 21 06:48:47 myserver sshd[1708]: Failed password for root from ######## port 60021 ssh2
Jun 21 06:48:47 myserver sshd[1708]: Received disconnect from #######: 11:  [preauth]
Jun 21 06:48:47 myserver sshd[1708]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=************  user=root
Jun 21 06:48:47 myserver sshd[1730]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=************  user=root
Jun 21 06:48:48 myserver sshd[1732]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=============  user=root
Jun 21 06:48:48 myserver sshd[1730]: Failed password for root from ************ port 60094 ssh2
Jun 21 06:48:50 myserver sshd[1732]: Failed password for root from ============ port 40613 ssh2
Jun 21 06:48:50 myserver sshd[1730]: Failed password for root from ************ port 60094 ssh2
Jun 21 06:48:50 myserver sshd[1734]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=************  user=root
Jun 21 06:48:52 myserver sshd[1736]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=************  user=root
Jun 21 06:48:52 myserver sshd[1732]: Failed password for root from ============ port 40613 ssh2
Jun 21 06:48:52 myserver sshd[1730]: Failed password for root from ************ port 60094 ssh2
Jun 21 06:48:52 myserver sshd[1730]: Received disconnect from ***********: 11:  [preauth]
Jun 21 06:48:52 myserver sshd[1730]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=***********  user=root
Jun 21 06:48:52 myserver sshd[1734]: Failed password for root from ######## port 47803 ssh2
Jun 21 06:48:54 myserver sshd[1736]: Failed password for root from ######## port 55371 ssh2
Jun 21 06:48:54 myserver sshd[1732]: Failed password for root from ============ port 40613 ssh2
server
  • 1 个回答
  • 757 Views
Martin Hope
MohammedSimba
Asked: 2015-06-04 01:50:55 +0800 CST

安装旧版本的 Mysql、Apache2、PHP

  • 1

有没有办法安装以下版本的旧包:

apache2: 2.2.12

mysql: 5.1.37

PHP 5.2.10

在 Ubuntu 12.04、i386 上,使用apt-get或dpkg?

12.04
  • 1 个回答
  • 3296 Views
Martin Hope
MohammedSimba
Asked: 2015-05-20 05:28:05 +0800 CST

ubuntu服务器无法安装acl

  • 2

setfacl/getfacl 命令没有在我的服务器上运行,它说:

The program 'setfacl' is currently not installed. You can install it by typing:
sudo apt-get install acl

当我尝试安装它时,它说:

sudo apt-get install acl

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package acl is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'acl' has no installation candidate
14.04
  • 1 个回答
  • 17150 Views
Martin Hope
MohammedSimba
Asked: 2015-05-13 04:37:39 +0800 CST

使用 .pem 文件将 ssh 连接到亚马逊实例权限被拒绝(公钥)

  • 3

我正在尝试登录到亚马逊上的实例,我的“.pem”文件有 600 个权限:

ssh -v -i FTPServer.pem [email protected]

我尝试了所有可能的用户“root/ubuntu/ec2-user..”我总是收到以下信息:

    OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com [xx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: identity file FTPServer.pem type -1
debug1: identity file FTPServer.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-8
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-6ubuntu2
debug1: match: OpenSSH_5.1p1 Debian-6ubuntu2 pat OpenSSH_5* compat 0x0c000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 0f:ad:a5:01:e1:75:82:fa:54:bd:56:53:34:d9:7e:6b
debug1: Host 'ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com' is known and matches the RSA host key.
debug1: Found key in /home/myhome/.ssh/known_hosts:6
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: Downloads/FTPServer.pem
debug1: Authentications that can continue: publickey
debug1: Trying private key: FTPServer.pem
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
server
  • 2 个回答
  • 12537 Views
Martin Hope
MohammedSimba
Asked: 2015-05-08 04:09:12 +0800 CST

init.d 下的 Apache 守护进程文件为空

  • 1

一些我的 Apache2 守护进程/etc/init.d/apache2几天前变空了,因为我注意到它在过去几天影响了日志轮换过程。

我的apache版本是Apache/2.2.12 (Ubuntu)

如何在不重新安装 apache 的情况下以安全的方式再次恢复该脚本,并保持我当前的配置和所有虚拟主机不变?

server
  • 1 个回答
  • 1151 Views
Martin Hope
MohammedSimba
Asked: 2015-05-06 08:43:10 +0800 CST

Apache 日志文件生成

  • 1

在我的服务器中,我发现在 下/var/log/apache2/,日志是access.log几天前生成的,但是它们是空的(对于访问日志和错误日志),这种情况发生在我服务器上配置的所有虚拟主机上,

直到这一刻,所有新日志都已添加access.log.1,我需要将所有新日志添加access.log到Error.log文件中。

如何解决此问题?

/etc/logrotate.d/apache2如下:

/var/log/apache2/*.log {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 644 root adm
    sharedscripts
    postrotate
            if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
                    /etc/init.d/apache2 reload > /dev/null
            fi
    endscript
}

编辑:我刚刚发现 /etc/init.d/apache2 文件几天前变空了,我不知道怎么办!!,有什么办法可以恢复它吗?我的 apache 版本是:Apache/2.2.12 (Ubuntu)

server
  • 1 个回答
  • 1520 Views

Sidebar

Stats

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

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve