Linux

66K

Solutions

33K

Contributors

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

Share tech news, updates, or what's on your mind.

Sign up to Post

On a Linux server, I have a user that keeps getting asked for a new password.  I have tried chage -E and that doesn't work.  When I run passwd -S I get the epoch date and can't figure out how to change it.  Here's what it looks like:

servername:/root# passwd -S username
username PS 1969-12-31 0 90 7 -1 (Password set, SHA512 crypt.)

I think it's a pam issue, but I don't know the command and haven't been able to google it.

Thanks,
David
0
Ensure you’re charging the right price for your IT
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

just built a vm running fedora 30.  downloaded and compiled apache 2.4.41 but only partially working.  i have ssl configured but https doesn't work.  the log file shows mod_ssl/openssl present, initializing servers for ssl, configuring tls extension handling, shows the certificate and private key, conf file has it listening on 443 but using netstat only shows http.  no errors int he log, selinux is disabled.  can't figure out why this piece isn't working
0
Best Linux Distro for Linux Administrator.

I am not sure what Linux Administrator job encompasses, but I would like to know which Linux Distro is mostly used by Linux Administrators at work.
I mean if I learn Centos or Ubuntu, will that get me a job as Linux Administrator, or it is not enough.

I have also heard about Linux Network Administrator that 's new to me. I know that Networking is dominated by Cisco and Juniper.

Thank you
0
Hello Ee,

I created a local repo for a CentOS 7.6 isolated instance with no internet, and copied a bunch of rpm files over from media to local directory . I created the proper repo file in /etc/yum.repos.d and pointed to the proper directory for the rpms, ran the createrepo ok . Question is , if I wish to add more rpms or delete rpms , how do I update/sync to show the newer packages and package count ? I tried 'yum clean all ' , no luck .
0
Hello EE,

I have a RHEL8 instance running in vmware player , mounted a usb stick to /media/usb and downloaded numerous rpm packages using the --downloadonly option and copied them to /media/usb. The usb is in vfat formatting. Next, I wish to use the usb stick as a repo on a seperate isolated centos7 instance . I  mount the same usb stick in a centos7 instance ok to /media/usb , however i cannot see the rpm files previously written to the usb stick, however if I "ll" , it states 33 files . Do I simply need to mount back on the RHEL8 instance and chmod 777 all files and directories ? Is there other steps I should be doing here for best practices ?
0
Hi tesseract OCR experts,

I’ve just installed tesseract on my Raspberry Pi running Linux (Raspbain) and I’m trying to extract text from PNG screen shots taken on my phone.  (I have hundreds of these screen shots, all in the same size & format, taken over the last year using the LeafSpy Lite app, for the Nissan LEAF EV, and I'll be extracting text from all of them.)

The problem I have is, some of the text is not being extracted.

When I run this command:
$ tesseract sample1.png sample1
It produces sample1.txt (attached), which includes plenty of useful figures, but it excludes:
-      “11.84V” near the bottom left (nice to have this voltage figure, but not vital), and
-      “32.0%” at the bottom (I really need this SOC figure).

I tried feeding tesseract a negative (created with IrfanView on Windows) of the image, in case it was a black/white issue, but that gave the same output.
I tried cropping the 11.84V and 32.0% figures out to TIF files (see sample1_voltage.tif & sample1_soc.tif attached, also created with IrfanView on Windows) then running them through tesseract, and that:
-      failed for the 11.84V (see empty sample1_voltage.txt attached), but
-      worked for the 32.0% (see sample1_soc.txt attached).

I know bash and Perl scripting.  I don’t know Python, but Python is installed so it could be used if necessary, if someone else writes the code, but it's not my preference.
ImageMagicK is also installed, in case I need to use it for cropping or whatever.…
0
I created an Azure VM using the CIS Hardened Ubuntu image. When setting up the VM I chose to use a public/private key to access the VM. This was in April of this year. Now when I logon its telling me my password has expired but we never gave the user a password.

I'm guessing that this is due to the hardened CIS image and it wants us to change the password. However we dont know what the old password would be. Using the serial console in Azure I can create another admin user and i tried to use chage -d -1 <user> but that doesnt seem to work.

I'm wondering if anyone else has come across this issue or can help me find a way to remove the password expiration.
0
Hi,

I'm using Chrony to configure the ntp client and it seems like every evening I keep losing the NTP synchronization which makes the time leap forward.

Sep 30 22:10:00 xxxxxxx chronyd[32710]: Forward time jump detected!
Sep 30 22:10:00 xxxxxxx chronyd[32710]: Can't synchronise: no selectable sources
Sep 30 22:13:13 xxxxxxx chronyd[32710]: Selected source 193.190.253.212
Sep 30 22:13:13 xxxxxxx chronyd[32710]: System clock wrong by -7439.358171 seconds, adjustment started
Sep 30 22:18:38 xxxxxxx  chronyd[32710]: Selected source 194.78.244.172

Open in new window


Lists of NTP Servers I'm using:

server 0.be.pool.ntp.org iburst
server 1.be.pool.ntp.org iburst
server 2.be.pool.ntp.org iburst
server 3.be.pool.ntp.org iburst

restarting chrony resolves the issue, but it keeps happening
0
I have a CentOS 7.7-1908 clean install on a sever.  I was having trouble with YUM updating packages and I attempted to clear out the broken YUM records and start fresh.  I made it worse, and now the server isn't working at all.  I keep getting a message:

[root@localhost ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable Red Hat Subscription Management repositories:
     subscription-manager repos --enable <repo>
 To enable custom repositories:
     yum-config-manager --enable <repo>


Only there are no repositories in the list when I try to run the suggest commands.  Is there any way to get this back without wiping the server and starting over?  Tried some research but nothing seems to work.
0
I'm having serious problems to make my kiosk printer (Nippon Primex NP-VK30) work correctly under Ubuntu 19.04.
The manufacturer provides no support for Ubuntu, but I've found on Github a very simple library made in Python.
I attached the Python files to this topic.

I tried to launch "test.py" and my printer worked fine!

Since I need to print some text strings from my C/C++ application, I would like to translate the python code into C/C++ code so I can easily import it in my original application.

Unfortunately, I'm just a beginner and I never coded in Python.
Can you help me, please?

Thank you!

This is the code for test.py:

#!/usr/bin/python
from w2k203dpi import Printer

p = Printer()

p.println('test')

p.bold(True)
p.println('test')
p.bold(False)

p.underline(True)
p.println('test')
p.underline(False)

p.qrcode('test')

p.fullcut()

Open in new window


This is the code for the class file:

class Printer:

    def __init__(self):
        DEVPATH = '/dev/usb/lp0'
        self.f = open(DEVPATH, 'w')
        self.mode = 0x00

    def raw(self, data):
        for i in data:
           self.f.write(i)
        self.f.flush()

    def esc(self, data):
        self.raw('\x1b' + data)

    def font(self, value):
        if value:
            self.mode |= (1 << 0)
        else:
            self.mode &= ~(1 << 0)
        self.esc('!' + chr(self.mode))

    def bold(self, value):
        if value:
            self.mode |= (1 << 3)
        else:
         

Open in new window

0
JavaScript Best Practices
LVL 13
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

How do I check a history of commands executed by sudo?
I checked /home/username/.bash_history file but it contains only commands executed by the user.
I use RedHat 7.4. It's appreciate if I can know how to check sudo command history.
0
hello,
i need to install an erpnext open source in my company, could anyone provide me with guide to install it i tryed many links but not working,
installing can be on ubuntu 18.04 or cento 7

thanks,
0
Hi,

We are moving from a HP-UX system to a Linux RedHat system.

We have some ansi C / proC programs running and I have troubles to get them compiled on the new system.

To get it compiled I had to remove some flags and commands because they are not available on the new compiler like:
gcc +s option
-D_HPUX_API_LEVEL=20040821 option
chatr +s enable ctpdb
-lsql11 became -lsqlplus

One error remains but I get it compiled eventually:
ctp_str.h:69:5: error: unknown type name ‘BOOLEAN’
     BOOLEAN ctp_maintain_gcns;

Eventually I get them compiled, but they crash every time the programs use a function that is extern (so not in the own *.pc member)
e.g. extern void ctp_gen_setup_test_flags
At runtime it just gives "memory fault"
Probably because I have no alternative for the chatr command and the +s flag...

Please advice on how I can get it compiled and running so that it is able to call the functions in external member.

I attach the original makefile that compiles the code on HP-UX, but not on linux, so that you can advice how the new makefile should look like.

Regards and thank you in advanced,
Tim
0
i have ipa server running on centos 7. i create user from ipa ldap.
id "username"  return uid, gid and groups successfully.
i try to login to server via su - "username"  return
su: cannot set groups: Invalid argument
What is wrong?
ls -l /bin/su  is also ok. permission  -rwsr-xr-x 1 root root 32128 Aug  9 03:10 /bin/su
The same permission for /etc/shadow and /etc/passwd
-rw-r--r-- 1 root root 1467 Sep 22 20:59 /etc/passwd
-rwsr-s--- 1 root root 827 Sep 23 11:11 /etc/shadow

Help
0
In fact this are really three question:
1.) is grep -f memory friendly? (so could I avoid writing any python code)
2.) Does somebody have already a working solution for below problem?
3.) Could you make suggestions or review my code as soon as it starts working.


I'm trying to find a solution, that works for really huge files. (will not  use more RAM if files have more lines)
The problem: identify all lines, that exist in the first file, but don't exist
in the second one. In none of the files the same line can occur twice

Here a small example:

file1 (f1.txt)
aba
abb
abd
abf
one
two
three
four
five
six
seven

Open in new window


File2 (f2.txt)
abd
abe
eleven
four
eight
one
six

Open in new window


The expected result (order is not relevant)
aba
abb
abf
five
seven
three
two

Open in new window


I have already three approaches and an idea for the fourth one
1.) use grep -v -f f2.txt  f1.txt but I know nothing at all about memory consumption
2.) both files can be read into memory (so not suitable for huge files)
3.) the first file is huge the file fits into memory (so not suitable if the second file is huge)
4.) I'm working on it. In the moment the solution does not work as I didn't finish it. The idea es explained below

I have an idea of how to implement a solution, but wanted to know whether anybody has already written such code or knows of a standard solution.

My idea is to sort both files (the default linux sort is quite smart and ensures, that it works …
0
Hello!
I've found onine is pretty decent video tutorial about BASH. But it's dated around 2010. I think Ubuntu 10.10 or so... You think I can still learn today by using that old tutorial or there're changes in BASH in last years that render that course obsolete?
0
After running the CIS hardening script on our RHEL 7,
Mesosphere can't install at all : I don't have the error
message as app team & vendor working on it.

General questions:

Q1:
Besides logging a case with reseller/vendor (which often
disappoints, what's the fastest way to isolate/narrow
down which hardening item caused an issue?
Binary (ie harden half & then kept halving down) isolation
or google for the error?  

Q2:
Or are there free tools out there (in Tripwire we can quickly
tick/untick for remediation/auto-remediation) to ease this
isolation (esp for Linux & Windows)?
0
Within an ssh session on an instance, here is what I'd like to accomplish:

Steps in Script:
1.  Move a file (each file starts with "cfrtl4" - about 8 files total) from the remote systems /tmp directory to the etc/deployment-apps  
      directory as the SudoUser.
2.   Continue the same process until each "cfrtl4" file from the /tmp directory has been moved into the etc/deployment-apps
      directory.
3.   Next, I'd like to chown the /opt/splunk/etc/deployment-apps directory as SudoUser:
       e.g. sudo chown -R splunk:splunk /opt/splunk/etc/deployment-apps
4.   I need to log out of SudoUser and log back in as splunkuser so that I can reboot the instance:
      sudo su splunk
5.   Now as the splunk user, I need to navigate to:  cd /opt/splunk/bin
6.   Once in the /bin directory, I need to issue a reboot command, e.g. ./splunk restart
   
[code]

#!/bin/sh
#--- Execute the script from the /tmp directory ---
sudo mv cfrtl4_all_deployment_client/ /opt/splunk/etc/deployment-apps
sudo mv cfrtl4_all_indexer_base/ /opt/splunk/etc/deployment-apps
sudo mv " "
sudo mv " "
sudo mv " "

# --- Once all of the file shave been moved from /tmp to the /deployment-apps directory, then chown the deployment-apps    
     directory ---

sudo chown -R splunk:splunk /opt/splunk/etc/deployment-apps
# --- Exit out of sudouser ---
exit
# --- Navigate to the bin directory ---
cd /opt/splunk/bin/
# ---Issue reboot command ---
./splunk restart
0
I've got a script located at:
/Users/me/Desktop/Distributed_Lab/Scripts

I'm trying to invoke the script using:  
./myscript.sh

When the script runs it gives me this message:
Desktop/cfrtl4_all_indexer_base: No such file or directory

A portion of my script is below:
#!/bin/sh
# ----- Variables -----
SHIP="xx.xxx.xx.xxx"
# ----- Script -----

# --- Search Head ---
sudo scp -r Desktop/Distributed_Lab/Apps/cfrtl4_all_indexer_base username@$SHIP:/tmp

Open in new window


I'm initiating the script from my local system where I have administrative rights.  However, I've tried the scp command with sudo and without.  Same result.  It keeps giving me this message:

"Desktop/cfrtl4_all_indexer_base: No such file or directory"

Why is the message referring to only the Desktop/ as the path and not the entire path?  More importantly, it's not seeing the file that I need to move from my Apps directory.  I created this script to move about 10 files over from my Desktop/Distributed_Lab/Apps directory which is on my local drive, on to a remote systems /tmp directory.   Any help is greatly appreciated!
0
Become a Certified Penetration Testing Engineer
LVL 13
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

I've got a simple bash script (see below) that I am trying to run but it keeps choking on me for some reason.  It will make it as far as bringing the .tgz file down but when it try's to untar it, it will crap out.  I've checked permissions, those are fine.  

[code]#!/bin/sh

cd /opt

sudo yum install -y wget

sudo adduser splunk

sudo wget -O splunk-7.3.1-bd63e13aa157-Linux-x86_64.tgz 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=7.3.1&product=splunk&filename=splunk-7.3.1-bd63e13aa157-Linux-x86_64.tgz&wget=true'

sudo tar -xvzf /opt/splunk-7.3.1-bd63e13aa157-Linux-x86_64.tgz

sudo mv /tmp/cfrtl4_* /opt/splunk/etc/deployment-apps

sudo cp -avr /opt/splunk/etc/deployment-apps/cfrtl4_all_search_base /opt/splunk/etc/apps

sudo cp -avr /opt/splunk/etc/deployment-apps/cfrtl4_all_forwarder_outputs /opt/splunk/etc/apps

sudo cp -avr /opt/splunk/etc/deployment-apps/cfrtl4_full_license_server /opt/splunk/etc/apps

sudo cp -avr /opt/splunk/etc/deployment-apps/cfrtl4_search_volume_indexes /opt/splunk/etc/apps

sudo chown -R splunk:splunk splunk

sudo splunk/bin/splunk enable boot-start -user splunk --accept-license

sudo chown -R splunk:splunk splunk

sudo splunk/bin/splunk start/code]

Here is what the terminal shows where it is erroring out at:
[code]sudo ./cfrtl4_sh1.sh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: repos-va.psychz.net
 * epel: …
0
I have a linux VM in Azure but I'm curious, is there a built in way in Azure to backup/export files within the VM? Like from the /home folder?  
I have VM backup but not sure that gives me file level restore and/or a way to restore them out to another destination like blob storage or a file server.
0
Dear all
    What happens in NFS if 2 or more servers try to write the same file simultaneously
0
Hello!
I've got Ubuntu 16.04 and OpenVPN installed and seems to be working fine. But when I check firewall rules using "sudo ufw status", then I see this:
Status: active

To                         Action      From
--                         ------      ----
80                         ALLOW       Anywhere                  
443                        ALLOW       Anywhere                  
53                         ALLOW       Anywhere                  
465                        ALLOW       Anywhere                  
25                         ALLOW       Anywhere                  
110                        ALLOW       Anywhere                  
995                        ALLOW       Anywhere                  
143                        ALLOW       Anywhere                  
993                        ALLOW       Anywhere                  
10025                      ALLOW       Anywhere                  
10024                      ALLOW       Anywhere                  
80 (v6)                    ALLOW       Anywhere (v6)             
443 (v6)                   ALLOW       Anywhere (v6)             
53 (v6)                    ALLOW       Anywhere (v6)             
465 (v6)                   ALLOW       Anywhere (v6)             
25 (v6)                    ALLOW       Anywhere (v6)             
110 (v6)                   ALLOW       Anywhere (v6)             
995 (v6)                   ALLOW       Anywhere (v6)             
143 (v6)                   ALLOW       

Open in new window

0
i have an iso of 18.04.3 desktop-amd64.iso.  how do i burn this to a dvd?  i've done it before but i forget.  i'm currently running ubuntu 16.04.
0
How do i do a FULL directory search on a Linux box.  I want to look at the ENTIRE directory structure for a file.  In this example, I am looking for a file by the name of "email_log".

I am currently using:

find / -type f -name "email_log" and I've used sudo find / -type f -name "email_log" too, but when i hit enter, it wants the sudo password, which I enter in and it doesn't find anything. Is my search syntax incorrect?
0

Linux

66K

Solutions

33K

Contributors

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.