Tagged Questions

Bash is the Bourne Again SHell, the successor to the classic Unix sh (shell).

learn more… | top users | synonyms (1)

0
votes
0answers
9 views

roundcube upgrade from 0.9.5 to 1.0.2 : Got error -1 from storage engine

My OS is CentOS 6.5 final. I upgraded roundcube from 0.9.5 to 1.0.2. On their page they said they have created an update script that I launched. But when I do, I get this : [root@webmail ...
0
votes
3answers
25 views

Modify config file settings from bash

I need to modify a config file from a bash script, changing the values of particular settings. I need to make the change using common Linux tools (sed/awk/tr/etc.). The config file can have ...
0
votes
1answer
37 views

How to grep a continuous stream, with paging

I posted this to Superuser but got no takers: http://superuser.com/questions/832578/how-to-grep-a-continuous-stream-with-paging I want to take a log file and filter out some irrelevant log entries, ...
0
votes
1answer
24 views

How to check the existence of multiple directories?

I have a script which obviously faulty: if [ -d "$BACKUP/${DATE_MAX}_"* ] then ... fi This script would only work if there is a single or no directory there at all. If there are multiple ...
2
votes
1answer
14 views

Apache - add http headers to requests, using script (bash, perl, php etc) to set the headers

I trying to work out the feasibility of a project where I want to be able to have a script run on every request (preferably filtered by mime type), and a script run to set the headers for the ...
0
votes
0answers
19 views

permission denied error too many arguments

When first time I log in as root, i get a message about permission denied: bash: /usr/bin/id: permission denied [:= unary operator expected What could be causing it?
1
vote
1answer
47 views

Why deployment sh script don't fails on failed nginx reloading?

I have sh script that restart nginx like the following: #!/bin/sh -e set -e error_exit() { d=$(date '+%D %T :: ') echo "$d Error: $*" >&2 exit 1 } if ! sudo service nginx ...
0
votes
0answers
17 views

NUT UPS: stop specific service on power failure

Does anybody know how to stop a service when there is a power failure using NUT? I made a custom script like this, the problem is that the script user (NUT) does not have root permissions to stop the ...
0
votes
1answer
20 views

Script that checks and runs a jar, sometimes runs it twice.

I jave written a small bash script to run every 10 minutes, check if a certain program is running and if not run it. However, I noticed that sometimes I have two instances of the same program running ...
0
votes
1answer
18 views

Script to copy auth keys to remote servers needs password four times

I work on multiple servers through ssh. I have automated the copying of ssh auth keys with the script below. The only problem is it asks for the remote servers password 4 times. How can I change ...
3
votes
2answers
67 views

Why is my find -type d performing fstat on every file in a folder?

I'm running find . -type d on a rather large directory tree. I am only interested in finding directories within this tree, but when I ran an strace against the process to make sure it was doing what I ...
0
votes
0answers
28 views

Updating a Vyatta 6.6 box for Shellshock

A client has a few Vyatta installations that they're eventually wanting to replace with VyOS. In the interim, they're running Vyatta 6.6 (last version prior to the sale to Brocade). It's an internal ...
0
votes
0answers
27 views

AD Authentication with SAMBA, Winbind and SSS

I'm having trouble authentication with AD to a SAMBA share on a linux server. Authentication appears to be working, but only halfway... [root@myserver ~]# wbinfo -a my_ad_user%password123 ...
0
votes
0answers
7 views

date command, going back one or two days. Seeing different flags [migrated]

I'm writing a bash script that should run on OSX and Ubuntu. I'm not sure if this particular problem is due to an OS mismatch; more likely it's a difference in the date command on the two shells, ...
0
votes
2answers
31 views

Using find to exclude a directory and tar up everything else in a directory

I have following in a directory: dir1 dir2 file1 file2 I want to tar up everything except dir1 When I do: find . -path '*dir1*' -prune -o -print I don't see dir1 in the output ( as expected) ...
3
votes
1answer
34 views

List directories not containing a file which has a variable prefix

I'm checking the output from a script. In some cases the script has failed, and a certain file hasn't been produced. I want to check whether this file is present in a directory and if not, print the ...
1
vote
2answers
27 views

Hourly Clamscan cron script failes at reading file list

I've this piece of code located in /etc/cron.hourly/hourlyclamscan. #!/usr/bin/bash # Create Hourly Cron Job With Clamscan # Directories to scan SCAN_DIR=/home/transmission/Downloads # Temporary ...
0
votes
0answers
22 views

Linux: Process ignores signals

Processes running in Linux ignores signals (INT,QUIT,TERM) except KILL. Programs such as top, tail -f, sleep and etc, do not respond when pressing Ctrl+C and thus have to stop them from another ...
4
votes
2answers
71 views

SSH Login Failure “-bash: error while loading shared libraries: requires glibc 2.5 or later dynamic linker”

I did a blunder on one of my production server and its very old RHEL 4 host. Due to recent "shellshock vulnerability" by mistake I upgraded the bash to wrong version from RHEL5 repo. Now I am ...
-1
votes
0answers
33 views

Redirect stderr and stdout to another file descriptor [migrated]

exec 6>&1 will copy file descriptor 1 onto 6. But how can I copy both stderr and stdout (1 and 2)to file descriptor 6 ? Thanks,
1
vote
1answer
36 views

Why does printf work differently with sudo?

I have a simple script to convert a text file with colour escape sequences to the actual characters. It works if I run it directly, but not with sudo. To set up the scripts: test.txt ...
-3
votes
1answer
32 views

Dump all DB with Bash Script in separate files [duplicate]

I would like to easily dump all my DB without typing same stuff many times ... (I'm a dev and I have a lot of DB on my local machine ) Any Simple scripts that comes to your mind ?
0
votes
1answer
39 views

SVN Post Commit Issue (Calling Bash)

All, I would like to invoke a bash script (to do some rsync magic) towards the end of my post-commit hook. Here is what my post commit hook looks like: #!/bin/bash REPOS="$1" REV="$2" ...
0
votes
1answer
59 views

Getting the passphrase to ssh-keygen

I have a new private key that I'm bringing to a docker container as part of a bash script. After copying the private key to /root/.ssh/id_rsa I wanted to regenerate the public with: ssh-keygen -yf ...
0
votes
2answers
32 views

Converting string into CLI instruction

I have a the following in a bash script: cmd="composer install" `"$cmd"` which results in: composer install: command not found However if I just run this in the same bash script instead: ...
-1
votes
0answers
17 views

Centos 4 Updating bash [duplicate]

I have a old machine running centos 4.8 was wondering how I could apply the latest bash patch for shellshock. I know there is no support for centos 4 not but since its just a security update is there ...
1
vote
3answers
69 views

rsync using keygen login in bash script

So I have set up a password-less ssh login for a server. I can run rsync from the command line, and it works beautifully, and doesn't ask me for a password: rsync -avz -e ssh myDir ...
0
votes
0answers
29 views

Shell script permission denied despite +x flag [migrated]

This is an odd one, it only happens on one server (shared hosting, so I have limited access to configuration and logs), but I can't wrap my head around it. I have a shell script which runs some app's ...
0
votes
1answer
135 views

segfault error with bash on CentOS 6

I updated bash as soon as both patches were available, and using the test script at https://shellshocker.net, I am showing fixed on all vulnerabilities except for segfault. OS: cat /etc/*release* ...
1
vote
1answer
24 views

Losing carriage returns in variable assignment

If I assign a variable in Bash like so: PRIVATE_KEY="$(< ~/.ssh/id_rsa)" and then immediately dump that to a file: echo $PRIVATE_KEY > tmp.txt and then compare this to the original: diff ...
-1
votes
0answers
39 views

Server Shellshocked, how to find out how? [duplicate]

I have access to one server that is shellshocked and there is injected crontab along with altered ssh init script. Here is gist of file that does all the work Question is how to investigate how ...
0
votes
0answers
23 views

bash shellshock update causing script to behave differently [migrated]

This is one of the things that happened since we've updated our bash ( due to the Shellshock thing ) This is the code that I'm testing: #!/usr/bin/python2.4 import subprocess, os p = ...
12
votes
3answers
807 views

grep behaving differently on Fedora vs Ubuntu

So when I run this in Fedora I'm seeing this: $ ls hmm_data/indivA12_AATAAG/refs/par1/ 2R-orths.alleles 2R-ref.alleles $ ls hmm_data/indivA12_AATAAG/refs/par1/ | grep -F '-ref.alleles' ...
1
vote
1answer
1k views

ShellShock - Unable to update CentOS 5.7

[user@server1 ~]$ wget http://mirror.centos.org/centos-5/5/updates/x86_64/RPMS/bash-3.2-33.el5.1.x86_64.rpm [user@server1 ~]$ sudo rpm -Uvh bash-3.2-33.el5.1.x86_64.rpm warning: ...
2
votes
1answer
168 views

Collection of shell shock related logfile grep patterns

There are many topics on the shellshock bash vulnerability, but there isn't any collection of patterns that we could "grep" for in either the webservers access.log files and in the normal logs. ...
0
votes
1answer
134 views

How do I update bash on RHEL5 servers with expired contracts? [duplicate]

I have two servers with expired contracts that are both vulnerable to shellshock. I am in the process of migrating both to new servers with RHEL6 or greater depending when I get this done. That ...
0
votes
1answer
40 views

“File not found” from bash script executed by Apache (CentOS)

I have a bash script that sets up a classpath for accessing a series of JARs (it's tf, the cross-platform, command line tool for Team Foundation Server). The file structure is something like: ...
-2
votes
1answer
255 views

I've uninstalled/deleted bash and it's killed the server

I changed the default shell to zsh. And then proceeded to uninstall bash (this was via yast on SLES). To my horror I start to see everything deleted/uninstalled, apache, mysql . I can't putty into ...
0
votes
1answer
35 views

Password less mysql access to specified user/script only

In addition to this question: Performing root mysql operations in bash scripts I'd like to ask how to limit/allow this action (performing root administrative actions): mysql --local-path=mypath -e ...
0
votes
0answers
24 views

lftp mirror leaves empty folders on remote

My script is set up with this for lftp lftp -p 2218 -u $login,$pass sftp://$host << EOF set mirror:use-pget-n 5 mirror -c -P5 --depth-first --Remove-source-files ...
1
vote
1answer
111 views

CentOS fails to update Bash

I'm trying to patch my server against the Shellshock vulnerability issue. However, I'm unable to update Bash to a safe version, these are the results I'm getting: # yum update bash Loaded plugins: ...
-1
votes
1answer
24 views

how to change back to dash

I had used dpkg-reconfigure dash for ISPconfig installation, Now, I want to go back to dash again. Can anyone please help me with that. I am using Debian wheezy.
1
vote
2answers
85 views

Locked out after installing a bash without executable bit

After scp-ing a shellshock-patched bash binary to an openSUSE 12.2 Linux VM and replacing the login shell with it, no user can log in via ssh or the console. As it turned out, the executable bit got ...
0
votes
2answers
152 views

bash stuck at 3.2-24.el5 (Redhat)

I'm trying to update bash on our Red Hat Enterprise Linux Server release 5.6 server. But it won't find an update later than "3.2-24.el5". I've check and it is vulnerable for the shellshock ...
0
votes
5answers
111 views

Solaris - How to see if Bash is installed

never touched Solaris before is there an easy command to see if Bash is installed? Probably a silly question, thanks for your help
0
votes
0answers
74 views

How to fix Shellshock vulnerability on Debian Squeeze? [duplicate]

How do you fix the shellshock bash vulnerability on Debian Squeeze? (I originally posted just the answer but that got modded, go figure), so now I'll post the answer below...
0
votes
2answers
125 views

CentOS 7: Getting interface IP numbers

I am trying to autopopulate the /etc/issue in a CentOS 7 image (this will be a template, and it needs to be easy to identify the resultant VMs at a glance). I have the following in my ...
-1
votes
0answers
37 views

Dealing with Shellshock on Debian Squeeze for ARM [duplicate]

I am trying to fix Shellshock on Debian Squeeze on an small Armel plug server- The solution "Can not update bash on Debian Squeeze" . adding squeeze-lts repository to sources.list - can not be used ...
1
vote
1answer
307 views

Shellshock protection in Rackspace Ubuntu

I am trying to update my Ubuntu 13.10 servers in Rackspace to avoid Shellshock bug, but it is not working. Here is what I am doing: $ sudo apt-get update && sudo apt-get install ...
5
votes
1answer
2k views

Why are some CentOS 5 boxes still vulnerable to ShellShock after upgrading Bash?

I have two CentOS 5.10 boxen where I have upgraded bash to the latest version. However, in one of the boxes, bash is still vulnerable to CVE-2014-7169 (I am using the test from this ServerFault ...