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

MikiBelavista's questions

Martin Hope
MikiBelavista
Asked: 2025-01-14 22:07:44 +0800 CST

为什么我的 Ubuntu 安装失败?重新启动到 initramfs

  • 5

我已按照步骤一步一步操作-create-a-bootable-usb-stick 我的棒

Device        Start      End  Sectors  Size Type
/dev/sda1        64 12105119 12105056  5,8G Microsoft basic data
/dev/sda2  12105120 12115263    10144    5M EFI System
/dev/sda3  12115264 12115863      600  300K Microsoft basic data
/dev/sda4  12115968 61437951 49321984 23,5G Linux filesystem

当我重新启动笔记本电脑时,只出现

error file `/boot/` not found

我继续并完成一些事情但首先重启会回到 initramfs。

在此处输入图片描述 为什么?这是 BIOS 问题吗(我的笔记本电脑是 Hp EliteBook)?

ubuntu
  • 1 个回答
  • 23 Views
Martin Hope
MikiBelavista
Asked: 2025-01-14 16:05:27 +0800 CST

如何卸载 USB?/dev/sda 已挂载

  • 5

如果我尝试

sudo umount -f /dev/sda
umount: /dev/sda: not mounted.

但 Ventoy 失败了

sudo bash Ventoy2Disk.sh -i /dev/sda

**********************************************
      Ventoy: 1.0.99  x86_64
      longpanda admin@ventoy.net
      https://www.ventoy.net
**********************************************

/dev/sda1 /media/miki/Ubuntu\04024.10\040amd64 iso9660 ro,nosuid,nodev,relatime,nojoliet,check=s,map=n,blocksize=2048,uid=1000,gid=1000,dmode=500,fmode=400,iocharset=utf8 0 0
/dev/sda is already mounted, please umount it first!

lsblk 显示

loop49        7:49   0     7M  1 loop /snap/yq/2634
sda           8:0    1  29,3G  0 disk 
├─sda1        8:1    1   5,3G  0 part /media/miki/Ubuntu 24.10 amd64
├─sda2        8:2    1   4,9M  0 part 
├─sda3        8:3    1   300K  0 part 
└─sda4        8:4    1    24G  0 part

我应该尝试什么?

ubuntu
  • 1 个回答
  • 18 Views
Martin Hope
MikiBelavista
Asked: 2024-12-19 00:49:04 +0800 CST

如何将输出重定向到带有时间戳的文件?[重复]

  • 3
此问题这里已有答案:
如何将一个命令的输出作为命令行参数传递给另一个命令? (7 个答案)
6 小时前关闭。

Myscript 将每天运行,并删除旧文件。创建我想要重定向输出的文件

echo myproj-"date+ %Y-%m-%d"

现在从 CLI

jf rt del (some files) >如何在这里指定我的文件

每天都会有所不同,因为有时间戳。

如何添加?

linux
  • 1 个回答
  • 28 Views
Martin Hope
MikiBelavista
Asked: 2024-11-21 22:46:04 +0800 CST

如何 awk 使得其余行保持完整?

  • 3

我有线

* {@jira: PIVOT-9968} Provide a way to pass an `IMemoryCollector` to `IInternalMemoryMonitored#getMemoryStatistics(memoryCollector)` in order to prevent the count of duplicated blocks.

我只想转义第一个包含票号的字符。 编写脚本以添加反斜杠来 解决我之前的问题

* /{@jira: PIVOT-9968/} Provide a way to pass an `IMemoryCollector` to `IInternalMemoryMonitored#getMemoryStatistics(memoryCollector)` in order to prevent the count of duplicated blocks.

我试过

mawk '/^\* {@jira: PIVOT/ { gsub(/[{} ]/,"\\\\&") } 1' changelog.md > tmp && mv tmp changelog.md

并得到

*\ \{@jira:\ PIVOT-8019\}\ Pivot:\ Added\ `MaxAppendOnlyFunction`\ and\ \ `MinAppendOnlyFunction`\ aggregation\ functions\ that\ do\ not\ support\ disaggregation\ but\ can\ be\ used\ within\ an\ aggregate\ provider.

我应该改变什么?gsub?

awk
  • 1 个回答
  • 68 Views
Martin Hope
MikiBelavista
Asked: 2024-11-21 01:01:35 +0800 CST

如何编写带有反斜杠的脚本前缀括号

  • 4

我已经发布了使用 bash 添加转义字符。我需要为以 {@codeBlock 开头的文件中的每一行编写此脚本

所以

{@codeBlock: TEstBigquerry.buildPicks}

应该看起来像

\{@codeBlock:\ TEstBigquerry.buildPicks\}

我的脚本

#!/bin/bash

file=clfields.mdx

while read -r line; do
  if [[ "${line::11}" == '{@codeBlock' ]]; then
    printf '%q\n' "$line"
  else
    echo "$line"
  fi
done < clfields.mdx

终端输出正常,但文件保持不变。为什么?

bash
  • 3 个回答
  • 84 Views
Martin Hope
MikiBelavista
Asked: 2024-11-20 20:14:10 +0800 CST

如何使用 bash 添加转义字符?

  • 4

我想要这个

{@codeBlock: TEstBigquerry.buildPicks}

成为

\{@codeBlock: TEstBigquerry.buildPicks/}

我试过

sed -i '/{@/\{@' joana.txt

得到

sed:-e 表达式 #1,字符 5:未知命令:''

如何添加两次转义字符串?

bash
  • 1 个回答
  • 38 Views
Martin Hope
MikiBelavista
Asked: 2024-09-23 21:44:51 +0800 CST

Dockerfile 复制失败:构建期间“未找到“/azsh-linux-agent/start.sh”。为什么?

  • 5

这是我的 Dockerfile

FROM ubuntu:22.04

RUN apt update
RUN apt upgrade -y
RUN apt install -y curl git jq libicu70

# Also can be "linux-arm", "linux-arm64".
ENV TARGETARCH="linux-x64"

WORKDIR /azp/

COPY ./azsh-linux-agent/start.sh ./
RUN chmod +x ./start.sh

RUN useradd agent
RUN chown agent ./
USER agent
ENTRYPOINT ./start.sh

我尝试从 pwd 构建图像

/home/jh/azsh-linux-agent

当我尝试构建时出现错误

docker build --tag "azsh-linux-agent:1.0" --file "./azsh-linux-agent.dockerfile" .

像这样

--------------------
  10 |     WORKDIR /azp/
  11 |     
  12 | >>> COPY ./azsh-linux-agent/start.sh ./
  13 |     RUN chmod +x ./start.sh
  14 |     
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref c6a592e2-a63c-497e-addd-2fab546c3594::hy7y7sols7kbk34sms7iylyew: "/azsh-linux-agent/start.sh": not found

为什么没有检测到脚本?

ubuntu
  • 1 个回答
  • 21 Views
Martin Hope
MikiBelavista
Asked: 2024-03-05 17:15:17 +0800 CST

为什么在 pkg-config 搜索路径中找不到软件包 libnetfilter_queue?

  • 5

我试过

make all
go build -o bettercap .
go build github.com/chifflier/nfqueue-go/nfqueue:
# pkg-config --cflags  -- libnetfilter_queue
Package libnetfilter_queue was not found in the pkg-config search path.
Perhaps you should add the directory containing `libnetfilter_queue.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libnetfilter_queue' found
pkg-config: exit status 1
go build github.com/google/gousb:
# pkg-config --cflags  -- libusb-1.0
Package libusb-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libusb-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libusb-1.0' found
pkg-config: exit status 1

我使用的是 Ubuntu 22.04。

apt-cache search libnetfilter_queue
golang-github-chifflier-nfqueue-go-dev - Go bindings for NFQueue
libnetfilter-queue-dev - Development files for libnetfilter-queue1
libnetfilter-queue-doc - Documentation files for libnetfilter-queue1
libnetfilter-queue1 - Netfilter netlink-queue library
ruby-nfqueue - Wrapper around libnetfilter_queue using FFI

如何解决这个问题?我应该安装什么?

ubuntu
  • 1 个回答
  • 11 Views
Martin Hope
MikiBelavista
Asked: 2023-12-27 17:24:35 +0800 CST

为什么 Ubuntu 没有看到 npm?sudo:npm:找不到命令

  • 4

我跑

sudo npm install -g @angular/cli

得到

sudo: npm: command not found

让我们检查

nvm install v20.0.0
v20.0.0 is already installed.
Now using node v20.0.0 (npm v9.6.4)

和

which npm
/home/miki/.nvm/versions/node/v20.0.0/bin/npm

为什么npm好像没有安装?我在乌布努图 22.04。

ubuntu
  • 1 个回答
  • 32 Views
Martin Hope
MikiBelavista
Asked: 2023-05-09 17:09:13 +0800 CST

RUN rm -Rf 在 Dockerfile 中做什么?

  • 3

我在使用公司遗留代码时遇到问题。文件

FROM mycomp/tech:2.13

RUN rm -Rf /opt/app/src/api

COPY src/ /opt/app/src/
COPY config.json /opt/app/config.json

有什么RUN rm -Rf用?为什么写Dockerfile的人要加上呢?它将如何映射到容器中?

docker
  • 1 个回答
  • 58 Views
Martin Hope
MikiBelavista
Asked: 2023-05-02 22:11:10 +0800 CST

如何获得有关桥梁的完整信息?

  • 5

我的笔记本电脑上有很多网桥,Ubuntu 22.04

ip link show type bridge

节目

3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:53:00:0a:c6:8d brd ff:ff:ff:ff:ff:ff
3: mpqemubr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:53:00:83:b8:32 brd ff:ff:ff:ff:ff:ff
5: br-9910826e1e83: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default 
    link/ether 02:32:22:ee:e6:a7 brd ff:ff:ff:ff:ff:ff
6: br-9ceb855c322b: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 
    link/ether 02:32:58:1c:77:17 brd ff:ff:ff:ff:ff:ff
7: br-f6d0af00ea88: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 

我试过

ip link xstats type bridge
virbr0          
                    IGMP queries:
                      RX: v1 0 v2 0 v3 0
                      TX: v1 0 v2 0 v3 0
                    IGMP reports:
                      RX: v1 0 v2 0 v3 0
                      TX: v1 0 v2 0 v3 0
                    IGMP leaves: RX: 0 TX: 0
                    IGMP parse errors: 0
                    MLD queries:
                      RX: v1 0 v2 0
                      TX: v1 0 v2 0
                    MLD reports:
                      RX: v1 0 v2 0
                      TX: v1 0 v2 0
                    MLD leaves: RX: 0 TX: 0
                    MLD parse errors: 0

我不明白输出。如何获取有关接口的信息以及如何创建网桥?

ubuntu
  • 1 个回答
  • 30 Views
Martin Hope
MikiBelavista
Asked: 2023-04-29 17:14:11 +0800 CST

如何使用 scp 复制到 VM?

  • 5

我的 mininet 虚拟盒子

hostname
mininet-vm

ip a节目

inet 10.0.2.15/24

从我的客户端,传输到远程虚拟机:

scp 6jan.txt mininet-vm@10.0.2.15

我看不到任何传输的文件。为什么?

ubuntu
  • 1 个回答
  • 18 Views
Martin Hope
MikiBelavista
Asked: 2023-02-17 07:22:16 +0800 CST

为什么 snapd 安装失败?没有提供 snapd-2.57.6-2.el8.x86_64 所需的 bash-completion

  • 5

我运行命令

yum install snapd

得到

Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:04:34 ago on Thu 16 Feb 2023 03:14:18 PM UTC.
Error: 
 Problem: conflicting requests
  - nothing provides bash-completion needed by snapd-2.57.6-2.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@rhel ~]# yum install snapd --skip-broken
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:04:45 ago on Thu 16 Feb 2023 03:14:18 PM UTC.

我检查了名字

Linux rhel.localdomain 5.14.0-162.12.1.el9_1.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Dec 20 06:06:30 EST 2022 x86_64 x86_64 x86_64 GNU/Linux

为什么在 rhel9 上 snapd 安装失败?

rhel
  • 1 个回答
  • 14 Views
Martin Hope
MikiBelavista
Asked: 2022-10-07 04:58:51 +0800 CST

为什么密码修改失败?chpasswd:权限被拒绝

  • 0

我的 Dockerfile

FROM ubuntu:latest
RUN apt update
RUN apt install -y openssh-server sudo 
RUN useradd -ms /bin/bash -g root -G sudo -u 1000 remote_user
USER remote_user
WORKDIR /home/remote_user
RUN mkdir /home/remote_user/.ssh && chmod 700 /home/remote_user/.ssh
COPY remotecentos.pub /home/remote_user/.ssh/authorized_keys
RUN stat /etc/passwd
RUN  echo 'remote_user:*****2599*****' | chpasswd -c SHA256
RUN service ssh start
EXPOSE 22
CMD ["/usr/sbin/sshd","-D"]

我有错误

Step 9/13 : RUN stat /etc/passwd
 ---> Running in 7147677000bd
  File: /etc/passwd
  Size: 1325        Blocks: 8          IO Block: 4096   regular file
Device: 37h/55d Inode: 22961332    Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-10-06 12:45:10.000000000 +0000
Modify: 2022-10-06 12:45:10.000000000 +0000
Change: 2022-10-06 12:45:11.197943157 +0000
 Birth: 2022-10-06 12:45:11.197943157 +0000
Removing intermediate container 7147677000bd
 ---> 7b37835f7f2c
Step 10/13 : RUN  echo 'remote_user:******' | chpasswd -c SHA256
 ---> Running in faae63d7fd92
chpasswd: Permission denied.
chpasswd: cannot lock /etc/passwd; try again later.

如何修复容器内的权限?

我应该如何更改密码行?

ubuntu permissions
  • 1 个回答
  • 35 Views
Martin Hope
MikiBelavista
Asked: 2020-01-10 09:12:13 +0800 CST

如何在 Ubuntu 18.04 上安装 awscli?

  • 5

这应该是微不足道的,但似乎并非如此。我格式化了我的comp并安装了conda(我习惯了这个打包工具)

pip install awscli --upgrade --user
Requirement already up-to-date: awscli in ./.local/lib/python3.7/site-packages (1.16.313)

但现在我有问题

aws --version

Command 'aws' not found, but can be installed with:

sudo snap install aws-cli  # version 1.16.266, or
sudo apt  install awscli 

我试过了

sudo apt  install awscli
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package awscli 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 'awscli' has no installation candidate

我更新并升级了我的发行版,所以我看不到任何问题。如何解决这个问题?

快速安装

error: This revision of snap "aws-cli" was published using classic confinement
       and thus may perform arbitrary system changes outside of the security
       sandbox that snaps are usually confined to, which may put your system at
       risk.

       If you understand and want to proceed repeat the command including
       --classic.
ubuntu software-installation
  • 2 个回答
  • 8589 Views
Martin Hope
MikiBelavista
Asked: 2019-07-10 01:12:08 +0800 CST

如何更改我目录中所有文件的权限?

  • -1

我使用脚本安装 Hadoop

/opt/hadoop-3.2.0$ ll
total 216
drwxr-xr-x 10 yarn hadoop   4096 јул  9 08:05 ./
drwxr-xr-x  9 root root     4096 јул  9 07:42 ../
drwxr-xr-x  2 yarn hadoop   4096 јан  8 08:59 bin/
drwxr-xr-x  3 yarn hadoop   4096 јан  8 07:13 etc/
drwxr-xr-x  2 yarn hadoop   4096 јан  8 08:59 include/
drwxr-xr-x  3 yarn hadoop   4096 јан  8 08:58 lib/
drwxr-xr-x  4 yarn hadoop   4096 јан  8 08:59 libexec/
-rw-rw-r--  1 yarn hadoop 150569 окт 18  2018 LICENSE.txt
drwxrwxr-x  2 yarn hadoop   4096 јул  9 08:05 logs/
-rw-rw-r--  1 yarn hadoop  22125 окт 18  2018 NOTICE.txt
-rw-rw-r--  1 yarn hadoop   1361 окт 19  2018 README.txt
drwxr-xr-x  3 yarn hadoop   4096 јан  8 07:13 sbin/
drwxr-xr-x  4 yarn hadoop   4096 јан  8 09:32 share/

现在我想更改权限

/opt/hadoop-3.2.0$ whoami
miki

我的目标是 miki 是 hadoop-3.2.0 中所有文件的所有者。我想我应该使用chmod?命令应该是什么样子?

permissions chmod
  • 1 个回答
  • 41 Views
Martin Hope
MikiBelavista
Asked: 2019-07-09 23:41:15 +0800 CST

编辑 ~/.bashrc 文件后:找不到 ll 命令

  • 0

我正在我的 Ubuntu 上安装 Hadoop。

这是我现在的路径

echo $PATH
/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin:/home/miki/.local/bin:/opt/hadoop-3.2.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

如果我尝试ll

miki@miki:~$ ll
ll: command not found

我的 bashrc 编辑行

echo 'export HADOOP_HOME=/opt/hadoop-3.2.0;export PATH=$HADOOP_HOME/bin:$PATH' > ~/.bashrc

~/.bashrc 文件只有一行

export HADOOP_HOME=/opt/hadoop-3.2.0

所有以前的脚本都被删除了。

字母变了颜色也很奇怪。为什么?

permissions bashrc
  • 1 个回答
  • 721 Views
Martin Hope
MikiBelavista
Asked: 2019-06-25 06:24:43 +0800 CST

SSH 到 AWS Ec2:端口 22:连接超时

  • 1

我正在尝试 ssh(从我的 Ubuntu 18.04 桌面)到正在运行的 EC2 实例

ssh -i /home/miki/pizda/jk/keys/kur/kjam/python-kjam.pem ubuntu@ec2-18-194-207-247.eu-central-1.compute.amazonaws.com
ssh: connect to host ec2-18-194-207-247.eu-central-1.compute.amazonkur.com port 22: Connection timed out

同样如果我尝试IP

ssh -i /home/miki/pizda/jk/keys/kur/kjam/python-kjam.pem ubuntu@18.194.207.247
ssh: connect to host 18.194.207.247 port 22: Connection timed out

我可以ping IP

ping 18.194.207.247
PING 18.194.207.247 (18.194.207.247) 56(84) bytes of data.
^C
--- 18.194.207.247 ping statistics ---
544 packets transmitted, 0 received, 100% packet loss, time 556011ms

为什么我有 100% 的丢包率?如何设置安全组? 在此处输入图像描述 还有什么可能导致问题?

ssh aws
  • 1 个回答
  • 5266 Views
Martin Hope
MikiBelavista
Asked: 2019-06-04 22:43:41 +0800 CST

SSH 没有到主机的路由

  • 7

我正在尝试将我的 Corosync 密钥从我的桌面复制到我的笔记本电脑。

sudo scp /etc/corosync/authkey  mm-HP-Elit@192.168.0.10:~

我得到的是这个

ssh: connect to host 192.168.0.10 port 22: No route to host
lost connection

他们俩都在我家使用相同的路由器。

在我的桌面上,我正在 ping 笔记本电脑

ping 192.168.0.10
PING 192.168.0.10 (192.168.0.10) 56(84) bytes of data.
64 bytes from 192.168.0.10: icmp_seq=1 ttl=64 time=1.29 ms
64 bytes from 192.168.0.10: icmp_seq=2 ttl=64 time=1.08 ms
64 bytes from 192.168.0.10: icmp_seq=3 ttl=64 time=1.03 ms
64 bytes from 192.168.0.10: icmp_seq=4 ttl=64 time=1.05 ms
^C
--- 192.168.0.10 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 1.039/1.118/1.298/0.110 ms

    4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3004ms

Telenet 被拒绝

telnet 192.168.0.10 22
Trying 192.168.0.10...
telnet: Unable to connect to remote host: Connection refused

我的桌面IP

inet 192.168.0.12/24 brd 192.168.0.255 scope global dynamic noprefixroute enp3s0

我的笔记本IP

inet 192.168.0.10/24 brd 192.168.0.255 scope global dynamic noprefixroute wlo1

我的想法是打开端口 22. Netstat 输出

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:902             0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:38183           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:55181           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:38767         0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:2224            0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:8307          0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:57721           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:17500           0.0.0.0:*               LISTEN      3340/dropbox        
tcp        0      0 127.0.0.1:17600         0.0.0.0:*               LISTEN      3340/dropbox        
tcp        0      0 0.0.0.0:5473            0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:17603         0.0.0.0:*               LISTEN      3340/dropbox        
tcp        0      0 0.0.0.0:37795           0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::902                  :::*                    LISTEN      -                   
tcp6       0      0 :::48647                :::*                    LISTEN      -                   
tcp6       0      0 :::111                  :::*                    LISTEN      -                   
tcp6       0      0 :::2224                 :::*                    LISTEN      -                   
tcp6       0      0 :::80                   :::*                    LISTEN      -                   
tcp6       0      0 :::39283                :::*                    LISTEN      -                   
tcp6       0      0 :::51607                :::*                    LISTEN      -                   
tcp6       0      0 ::1:631                 :::*                    LISTEN      -                   
tcp6       0      0 :::443                  :::*                    LISTEN      -                   
tcp6       0      0 :::35835                :::*                    LISTEN      -                   
tcp6       0      0 :::17500                :::*                    LISTEN      3340/dropbox        
tcp6       0      0 :::2049                 :::*                    LISTEN      - 

我再次尝试打开 22

sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT

但我仍然没有看到 22 与 netstat

netstat -tpln | grep 22
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:2224            0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::2224                 :::*                    LISTEN      -  

如何解决这个问题?

已解决这是一个 sshd 问题。我清除并安装了 OpenSSH 服务器。

networking ssh
  • 2 个回答
  • 21021 Views
Martin Hope
MikiBelavista
Asked: 2019-05-29 01:36:49 +0800 CST

为什么更改块大小时 ls 显示文件大小不同?

  • 1

我想检查我的文件系统备份大小

ls -lia backup.tgz 
17 -rw-r--r-- 1 root root 84972633333 мај 28 10:05 backup.tgz

块大小为 M

 ls -l --block-size=M backup.tgz 
-rw-r--r-- 1 root root 81037M мај 28 10:05 backup.tgz

最后使用块大小 G

ls -l --block-size=G backup.tgz 
-rw-r--r-- 1 root root 80G мај 28 10:05 backup.tgz

有人可以解释如此巨大的差异吗?

files ls
  • 1 个回答
  • 1313 Views

Sidebar

Stats

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

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve