We help IT Professionals succeed at work.

Unix OS

33K

Solutions

18K

Contributors

Unix is a multitasking, multi-user computer operating system originally developed in 1969 at Bell Labs. Today, it is a modern OS with many commercial flavors and licensees, including FreeBSD, Hewlett-Packard’s UX, IBM AIX and Apple Mac OS-X. Apart from its command-line interface, most UNIX variations support the standardized X Window System for GUIs, with the exception of the Mac OS, which uses a proprietary system.

While putty is working remote connection times out without connecting. Any suggestions on this please in what could be the potential root causes.
0
I need to implement dzdo on a HP ux server. Server is already running centrify and connected to a domain. I found the instructions for setting up dzdo using the Access Manager GUI but I haven't found anything on how to do a via the command  line. Our servers do not have the GUI interface enabled.
0
Hi folks,

I am working on a Solaris-10 global server, which is hosting 7 non-global zones. There are two kind of network interfaces on our servers, admin and prod. There is one route, which is going via admin interface, I want to delete that and have that from prod interface.
e1000g0 is admin interface
e1000g3 is prod interface

 I want to delete this -
# netstat -nrv | grep 224.0.0.0
224.0.0.0            240.0.0.0       192.168.244.22       e1000g0:4  1500*    0   1 U        0      0
#

Open in new window

Since this is NGZ, I need to delete it from global zone. But I don't see this entry in route table on global server, what should I delete here? -
# netstat -nrv

IRE Table: IPv4
  Destination             Mask           Gateway          Device Mxfrg Rtt   Ref Flg  Out  In/Fwd
-------------------- --------------- -------------------- ------ ----- ----- --- --- ----- ------
default              0.0.0.0         192.168.241.1                1500*    0   1 UG    1072      0
default              0.0.0.0         216.221.133.193      e1000g3  1500*    0   1 UG   13020      0
10.0.0.0             255.0.0.0       192.168.244.1                1500*    0   1 UG       0      0
172.16.0.0           255.255.0.0     192.168.244.1                1500*    0   1 UG       0      0
192.168.64.0         255.255.252.0   192.168.244.1                1500*    0   1 UG       0      0
192.168.69.0         255.255.255.0   192.168.244.1                1500*    0   1 UG      54      0

Open in new window

0
hi am not able to ping another vm but am able to ping the same vm from another vm
ping23vmping234.PNG
0
I am wondering how can we monitor the permission on char file using monit application

I have below char file

/dev/null

and below monitrc config

check file dev_null with path /dev/null
if failed permission 666 then exec "chmod 666 /dev/null" as uid root and gid wheel

But it doesn't seems to work when file /dev/null has permission 600

I really appreciate any help on that.
0
I am running into issue to determine escape characters from master to remote server over ssh.  I can return desired output on remote server with no issues.  Trying to run similar string on master server to remote server to get same result.

Below example is working fine on remote server and has expected results:

[root@remote_server ~]# echo ${passwd_expire}
Jun 17, 2020
[root@remote_server ~]# echo ${current_date}
Jan 09, 2020
[root@remote_server ~]# echo $(( ($(date --date="$(echo ${passwd_expire})" +%s) - $(date --date="$(echo ${current_date})" +%s) )/(60*60*24) ))
159

Open in new window


I would like to run those remotely and get same output, but I keep running into bash errors and I can't determine which escape character I could be missing or if it's execution process order is incorrect.

server=remote_server


[root@master ~]# echo ${passwd_expire}
Jun 17, 2020
[root@master ~]# echo ${current_date}
Jan 09, 2020
[root@master ~]# ssh -q ${server} "echo $(( ($(date --date="$(echo ${passwd_expire})" +%s) - $(date --date="$(echo ${current_date})" +%s) )/(60*60*24) ))"

Open in new window


Need some advice on how I can run similar string directly on remote server on this master server as well via ssh.
0
We're configuring our Solaris Weblogic to send via syslog
to Qradar log collector & vendor gave us the steps below:
however, I don't see anywhere in the steps below indicating
IP of the log collector (ie syslog server) & I think some steps
are missing.  Can anyone enhance it & add on any missing
steps/inaccuracies?

1.1      WebLogic 12.1.3.0
===================
Enable configuration auditing by one of these methods:
•      Use the Administration Console. Select the Configuration > General page for your domain and set the Configuration Audit Type. See "Enable configuration auditing" in the Oracle WebLogic Server Administration Console Help.
•      When you start the Administration Server, include one of the following Java options in the weblogic.Server command:
•      -Dweblogic.domain.ConfigurationAuditType="audit"
Causes the domain to emit Audit Events only.
•      -Dweblogic.domain.ConfigurationAuditType="log"
Causes the domain to write configuration auditing messages to the Administration Server log file only.
•      -Dweblogic.domain.ConfigurationAuditType="logaudit"
Causes the domain to emit Audit Events and write configuration auditing messages to the Administration Server log file.
0
Dear Experts,
I reckon you can help me, I'm struggling with assigning a variable in heredoc.
Everything works fine until I want to assign the pid value to a variable...

Script:

#!/bin/bash
set -x

#function
GetLine() {
ssh -T myuserid@"$server" <<EOF
sudo su - "$side""$container"
echo "$side""$container"
pgrep "$side""$container"
pid=$(pgrep "$side""$container")
echo "pid = "$pid""
exit
EOF
}


env=PRD
side=bas
for server in sv-com-bas-p1 sv-com-bas-p2
do
        suffix=$(echo $server | awk -F"-" '{ print $4 }')
        for container in cbs xcf
        do
        :
        GetLine
        done
done

Open in new window




Output:


+ env=PRD
+ side=bas
+ for server in sv-com-bas-p1 sv-com-bas-p2
++ awk -F- '{ print $4 }'
++ echo sv-com-bas-p1
+ suffix=p1
+ for container in cbs xcf
+ :
+ GetLine
+ ssh -T cgk_tam@sv-com-bas-p1
++ pgrep bascbs
bascbs
24426
pid =
+ for container in cbs xcf
+ :
+ GetLine
+ ssh -T cgk_tam@sv-com-bas-p1
++ pgrep basxcf
basxcf
26669
pid =
+ for server in sv-com-bas-p1 sv-com-bas-p2
++ awk -F- '{ print $4 }'
++ echo sv-com-bas-p2
+ suffix=p2
+ for container in cbs xcf
+ :
+ GetLine
+ ssh -T cgk_tam@sv-com-bas-p2
++ pgrep bascbs
bascbs
14642
pid =
+ for container in cbs xcf
+ :
+ GetLine
+ ssh -T cgk_tam@sv-com-bas-p2
++ pgrep basxcf
basxcf
16769
pid =



I know I most probably have to comment the variables in the pid=$(pgrep "$side""$container") line but whatever combination I tried was unsuccesful.
What am I missing?.
Thanks for your help.
0
If we have a need to retain (can be in zipped/gz format) bsm
(Solaris Basic Security Module), what's the sizing of the partitions
recommended?

I know it depends on the amount of activity but suppose I
currently have 2GB left, how much more to extend?

BSM is merged with auditd logs
0
What's the best practice for partitioning a Solaris 10 x86?

AIX & Solaris hardening benchmarks by CIS do not indicate
separate partitions for /var, /var/log, /tmp, /var/tmp (with the last
2 being world-writeable) but they're indicated for RHEL/CentOS.

Solaris 10 patches are often 2GB nowadays so is this
something we should cater for?

I'm on UFS (not ZFS).

Also, what's the swap size?  16GB?  In the days of
Solaris 2.2-2.5, Sun used to recommend double the
size of RAM for swap but this doesn't hold anymore
0
We have 6 Linux servers with support activated on all servers. Out of the 6 servers 2 are test servers.
I bought 4 new servers and installed new version of Linux and I want to deactivate  support license from the 2 test servers and activate in 2 new servers.
How to use the same license and activate support in the new servers? We no longer need the old test servers.
0
Q1:
Without TCL/Expect script, can someone provide  a Shell/Perl script  or way to automate changing of a couple
of Solaris account passwords every 60 days?  This is for nagios (& a couple other) Solaris accounts which we
have to auto-expire but we can't afford to miss, else the expired password would cause service disruption.
Passwd, usermod or RHEL's chage can't read input from a file, thus I've not been able to find a Shell/Perl
script to do this.  However, we don't want to install TCL/Expect in our Solaris 10.

Q2:
if we use sed or awk to change the 'hashed' password field of /etc/shadow,  would Solaris (or even RHEL)
deem the password has been changed or UNIX will still deem it's not changed yet as we're editing the
shadow/passwd files directly instead of using commands like passwd/usermod/chage to change
0
I have files in unix path
/test1/dev/etl/log

AA_RES_PERSON_20191124.CSV
AA_RES_PERSON_20191124.LOG
KKK_AAA_BB.CSV
AA_RES_TEST1_20191222.CSV

AND SO ON


What i want is find all files with aa_res just for yesterday and then delete it

i want to write it as unix script with number of days to delete as parameter and  /dev path enviorment as variable as code will run in uat and prod
0
We got an audit finding that our Solaris (& possibly Linux as well but I haven't
verify) OS account used for Nagios monitoring do not have password expiry.

Q1:
However, when a Solaris account got expired, it'll cause service disruption
(just like root's cron jobs): is there any way around this?

Q2:
Can we set the SHELL for the nagios account to   /bin/false or no shell so
that it's deemed as non-interactive account & don't require password
expiry?   Will Nagios still work with no shell or a false shell??

Q3:
if we change the password of this nagios account periodically, do we
need to change it in nagios (script or settings) somewhere?
0
hi how can i add user to a group in linux i what to move user from root group to another user
group
0
Hi Experts,
I do install Oracle 18c client on Solaris SPARC 64 using SSH from Windows 10 PC. I did configure the DISPLAY parameter as (My local IP:10.0)
When I run the installer, I get the following error message:

The java.library.path system variable is missing or invalid. Please set java.library.path with a correct value and retry the operation.

 2019-10-27_10-30-59.jpg
Could you please help me to fix the above issue?

Thanks in advance,
Daniel Mina
0
Was told by one of the vendor selling Ivanti (LanDesk related)
patch mgmt product that RedHat had since controlled it such
that any products that do patching for RHEL must have a
Satellite server with valid subscriptions for each RHEL endpoints
to be patched.

We don't want to do 'yum' (ie permit backend servers' connecting
to RHEL).


Q1:
So without Satellite, is there any products our there that could
do patching of RHEL endpoints?  

Q2:
Is this requirement to have Satellite something that Bigfix also
require?  Seems like the vendor selling Satellite is not aware.

Q3:
Is there any scripts or tools out there that could pull all the
patches down with a single RHEL subscription, build a patch
repository which can be propagated down to our RHEL
endpoints?   I recall an ex-colleague who has built an RHEL
VM that could do something like this but I've lost touch with
him.

Q4:
Some years ago, a member in SunManagers list shared with
me that Satellite could patch Solaris as well (possibly that's
in the days of RHEL Ver 4.x): is this still the case today that
Satellite could patch Solaris?   What about Ubuntu, Debian,
& CentOS Linuxes?
0
HI,

  I am developing a C++ application with libfuse on rhel 6.10. And, also a simple test application also there.

  When I run my test application with same arguments to fuse_main, works fine. But, with actual application, /dev becomes empty (corrupted).  I don't understand why this corrupts machine. I am running these apps with non-root user. added non-root user to fuse group as well as changed permissions to fusermount too.

   In which cases, /dev becomes empty due to any application.

Thanks
0
Hi everyone,

I am trying to zip in zfiles<state>.zip file multiple (1000s) files (ASCII files) and get a count of each zip file in most efficient way (without dirrectory names and compress better) in Unix Bash script (zipfiles.sh) just like it was in the DCL language below.  If anyone knows how to do the same zipping process in the Unix bash script please let me know. Any suggestions or examples would be appriciated!

Note:  statelist.txt file has all states to loop through


Here is the DCL code portion that I am trying to convert to Unix bash scripting:
define/nolog DATA dir1/data
define/nolog proglog DATA:ZIP.LOG

laststate := ' '

 open/read statelist STATELIST.TXT
read/loop:
 read/end = endread statelist laststate

if f$search("ASCIIFILE%''laststate'%%%%%.TXT").EQS " " THEN -
GOTO READ_LOOP

!-------------------------------------------------------------------------------------------------------------------------------
! Create ZFILES<state>.zip  by zipping all ASCIIFILE files and send ZIP.LOG to the mail list
!-------------------------------------------------------------------------------------------------------------------------------
ZIP  -9V ZFILES'laststate'.ZIP - 
             ASCIIFILE%'laststate'%%%%%.TXT

if .not. $status
 then
  open/append pglog proglog
    write  pglog "--- Error Zipping ASCIIFILE*.TXT files ---"
   close pglog 
       SAY " --- Error Zipping ASCIIFILE*.TXT files ---"
 mail/subject="--- Zipping all files ==> Failure ---"

Open in new window

0
Hi everyone,
I am trying to create a Menu script in Unix bash. A few issues that I am experiencing are:
1. Each Menu selection (#1,#2, and #3) ends right after I run each selection and the menu exits out back to the command line. I would like the Menu to ask a user if a user would like to continue with other selections (for example #2 or #3 if #1 was run in the first place) or exit the menu. Right now the Menu just exits after each selection without asking anything.  

2. In part of the selection #1, I would like to capture a value entered for "filecnt" (can be any number but 0) in the $parfl (parameter file). Right now this script allows to enter the value but that this value for some reason is not captured in the $parfl parameter file. The script creates the $parfl file but it is empty.  

What am I missing? Any suggestions or examples would be greatly appreciated. Thank you!


Open in new window

export DATA=/home/data
export EXEC=/home/exec

export parfl=${DATA}/parameterfile.txt
chmod 777 $parfl

#--------------------------------------------------
# Menu
#--------------------------------------------------

clear
echo "             Control Menu"
echo " "
echo "Selection 1: Run Script1"
echo "Selection 2: Run Script2"
echo "Selection 3: Run Script3 "
echo "Selection 9: Exit System"
echo -e "\n"
echo -e "*** Make a selection from the Menu above and press enter ***"
read select

select=$(echo $select | tr '[:lower:]' '[:upper:]')
if [[ (("$select" <…
0
How come sometimes the owner and group for some files look odd on my file system?
unnamed.png
0
Dear Unix Gurus,
I got a new server which the below in the root directories.
Now I need to mount a new directory '/data/inout' here .
IS there a way we can do this.
ls -la
drwxr-xr-x.   2 root    root       6 Dec 14  2017 srv
drwxr-xr-x.   2 root    root       6 Dec 14  2017 mnt
drwxr-xr-x.   2 root    root       6 Dec 14  2017 media
drwxr-xr-x.   3 root    root      18 Sep 27  2018 export
lrwxrwxrwx.   1 root    root       7 Sep 27  2018 bin -> usr/bin
lrwxrwxrwx.   1 root    root       9 Sep 27  2018 lib64 -> usr/lib64
lrwxrwxrwx.   1 root    root       7 Sep 27  2018 lib -> usr/lib
lrwxrwxrwx.   1 root    root       8 Sep 27  2018 sbin -> usr/sbin
drwxr-xr-x.  13 root    root     155 Sep 27  2018 usr
drwxr-xr-x.   2 root    root       6 Sep 27  2018 tmproot
lrwxrwxrwx.   1 root    root      10 Sep 27  2018 esm -> /opt/DBesm
drwxr-xr-x.   4 root    root      33 Sep 27  2018 SSH_Keys
drwxr-xr-x.  11 root    root     128 Sep 27  2018 opt
drwxr-xr-x.  21 root    root    4.0K Oct  8  2018 var
dr-xr-xr-x.   4 root    root    4.0K Oct  8  2018 boot
drwxr-xr-x.   4 root    root      38 Apr 17 07:22 home
drwxr-xr-x. 105 root    root    8.0K Jul  1 02:00 etc
dr-xr-xr-x. 251 root    root       0 Jul  6 21:31 proc
dr-xr-xr-x.  13 root    root       0 Jul  6 21:31 sys
drwxr-xr-x.  19 root    root    3.3K Jul  6 21:31 dev
drwxr-xr-x.   2 root    root       0 Jul  6 21:31 misc
drwxr-xr-x.   2 root    root       0 Jul  6 21:31 net
drwxr-xr-x.  28 root    root    1000 Jul  6 

Open in new window

0
I have a 2 columns of data from oracle, moved to Excel, "Id_Num, Rand_Key"

I have another column that originated on Unix, sent as *.txt, loaded to Excel, "Id_Num_from_Unix"

I'm trying to to VLOOKUP on the Id_Num_from_Unix to the Oracle.Id_Num, but it's not working.

If I compare the two fields, they are different, e.g., =IF(D24=G24,"ok", "Diff !"). But if I subtract the two numbers, I get 0. Visually they're the same.

If I hand type a number, it matches the column from Unix ... so that means the data originating from Oracle is at issue - - - but shouldn't I be able to convert the data type in Excel so things are equivalent? The lengths of the fields are both 6.

I've tried making both columns text, number, general. Can't seem to get the comparison to work.
Excel comparison not working
0
Adding User to Ubuntu

I need a user that I can use when I do not want to risk doing damage to my Ubuntu installation.

So, I ran

sudo su

then ran

adduser curiouswebster

following these instructions,
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04

is ran
usermod -aG sudo curiouswebster

but doesn't this add root privileges for curiouswebster??

If so, please help me downgrade the permissions.

I was hoping to log in as curiouswebster and install various systems, like Apache, MySQL, PHP and WordPress.

Shouldn't I use root for this?

Also, how do I log in as curiouswebster?

Thanks
0
What Ubuntu tools (or tips) make learning Ubuntu easier?

I have used LINUX here and there over the years, but always feel like it's the first time. Most of my software development jobs were Windows and Web, with Windows Server.

So, I just successfully SSH'ed to my AWS Ubuntu instance. AND need to get up and running quickly.


What tools can you suggest?

Is there a GUI I should consider?

Was the X-Windows??

And what other tools are there besides a GUI?

I expect to host a WordPress Podcast. So, any helpful tools or tips would help greatly.


Thanks
0

Unix OS

33K

Solutions

18K

Contributors

Unix is a multitasking, multi-user computer operating system originally developed in 1969 at Bell Labs. Today, it is a modern OS with many commercial flavors and licensees, including FreeBSD, Hewlett-Packard’s UX, IBM AIX and Apple Mac OS-X. Apart from its command-line interface, most UNIX variations support the standardized X Window System for GUIs, with the exception of the Mac OS, which uses a proprietary system.