Tagged Questions

A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion. Not only does it allows the user to run programs from a text interface, but frequently offers basic ...

learn more… | top users | synonyms

-1
votes
0answers
22 views

free file sync debian shell usage

I use free file sync on windows to sync files to my NAS on daily basis, now I want to do the same with my debian 7 box, however it is shell access only, before I attempt the install I want to know if ...
1
vote
1answer
30 views

Finding strings in files with relative path

I don't understand why this two commands don't provide the same result (the differrence is only relative vs. absolute path), can somebody explain it? annika /srv/www/pages/com.example.www/www/povruc ...
-1
votes
0answers
13 views

Pair web page folders with existing shell accounts in ISPConfig [on hold]

I have ISPConfig 3 on my CentOS6 box. Some of my users in ISPConfig have reegular shell account on that machine as well and want to maintain their source code from it. So now I am doing: setfacl -R ...
2
votes
2answers
62 views

bc: using “scale” with bash variable [closed]

Easily, I'm writing a script that needs some values with 2 digits after floating point. Trying to use bc I don't understand how use "scale", i.e. A=12 ; bc <<< $(($A/5)) it's correct, but ...
-2
votes
1answer
20 views

Create symlink if source exists

I'm trying to make a symlink to a directory if it exists only and cannot figure out how. I tried various ideas I found and none worked. Most notable idea that i thought would do the job was to use ln ...
0
votes
1answer
63 views

Unable to load dynamic library '/usr/lib64/php/modules/ssh2.so'

When I try to run any php script with my user within shell, I get the following warning: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/ssh2.so' - ...
1
vote
1answer
25 views

Why is find not excluding old files?

I want to copy all gzipped files from my apache logs that were created less than 43 days ago. As a test, I simply listed my files from find: sudo find /var/log/apache2/ -mindepth 1 -ctime -43 -name ...
1
vote
2answers
117 views

Expect script error send: Spawn id exp4 not open while executing

Update: Working code added here for others CREDITS to : http://serverfault.com/users/30957/glenn-jackman @Glenn I'm sorry! just apologizing and I mean it! Sorry Glenn your code need few changes ...
3
votes
3answers
51 views

How to pass command output as several arguments to another command

I have a command that produce a output like this: $./command1 word1 word2 word3 I want to pass this three words as arguments to another command like this: $ command2 word1 word2 word3 How to pass ...
0
votes
0answers
50 views

Cron occasionally fails with “grandchild #X failed with exit status 3”

I have cron jobs and every now and then they fail. Just after log message that the command has started, there is grandchild #X failed with exit status 3 message. On the next run scripts finishes ...
0
votes
1answer
29 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 ...
3
votes
2answers
74 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
13 views

Is there a way using the shell to install certificates and enable encryption in 389 directory server?

My client has a 389 directory server installation that I discovered does not have SSL enabled on it. I would like to do this but I've always had to do it using the Admin console. At some point they ...
1
vote
1answer
86 views

ShellShock test shows wget and curl access

I've fixed shellshock bug on my Debian 6 server and while testing on http://shellshock.brandonpotter.com/ I get "No Vulnerabilities Found" and that's OK but they also check other things and in the ...
0
votes
0answers
34 views

execute local command using ProxyCommand ssh

I am trying to execute local command using ssh and ProxyCommand in sys config but getting an error cat ssh_config Host ameyj-c Hostname x ProxyCommand bash -s "/home/abc/abc.sh" ssh ameyj-c ...
1
vote
1answer
53 views

SFTP for users (own site folder)

I'm trying to config SFTP, so that my users can access their own site folder (with PSFTP/FileZilla). I use Vagrant, CentOS7, NGINX and .sh file. This is my bootstrap.sh, for creating one of my users. ...
0
votes
0answers
14 views

Check if Cacti Boost is currently running

How can I find out whether the boost update process is running presently on Cacti? I want to check in a script before I start the regular system backup, delay my backup if it's boost is still running ...
0
votes
2answers
39 views

ssh-keyscan stderr comment on success

I am running a shell script to add fingerprints to known_hosts. Code is like this: status=$(ssh-keyscan -T 5 $remotehost >> ~/.ssh/known_hosts 2>&1) if [[ $? != 0 ]]; then echo -n ...
1
vote
2answers
123 views

Python Script portion failing to execute within init.d/ on RedHat 6.5, why?

I've created a init.d script called rmCluster which is supposed to execute a simple python script at shutdown which uses boto to shutdown a particular cluster of servers, with 755 perms, located in ...
1
vote
1answer
30 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
vote
2answers
107 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 ...
1
vote
1answer
321 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 ...
0
votes
1answer
51 views

Cron bash script skips second do/done set

I have a script that checks IPs for ping reply then tries to run an snmpwalk on them. I am trying to schedule the script to run weekly in cron. When I run the script in the shell, it runs perfectly. ...
1
vote
0answers
128 views

Encrypting/Decrypting a file using openssl through an autorun script

So I am trying to encrypt/decrypt a file using openssl. I am running it through a script that is automatically run when I mount a USB, and decrypts the file. However, it doesn't work quite right, so ...
0
votes
1answer
108 views

insserv: warning: script 'uwsgi' missing LSB tags and overrides

This is my code: #!/bin/bash daemon="$APPVENV/bin/uwsgi" args="--emperor $APPCONF/uwsgi/app.ini" pid="$APPDIR/emperor.pid" case "\$1" in start) echo "Starting uwsgi" ...
0
votes
0answers
46 views

Bash and background processes PGID and receiving signals

My actual problem is that a process I run in an rcfile in docker as docker run container bash --rcfile rcfile remains attached to the bash session by sharing the PGID which means that when I Ctrl-C an ...
0
votes
1answer
20 views

Trouble using ssh-key gen specifying location and password

This is my code: ssh-keygen -t rsa -C "$APP" This works perfectly. However it then asks me to specify location and password. I was hoping I can automate this all in one go, however this command ...
0
votes
0answers
53 views

Netstat count TIME_WAIT connections by port

I can obtain individual TIME_WAIT counts on a port, netstat -nat | grep :11300 | grep TIME_WAIT | wc -l; but how to do this based on all ports eg: 11300 2900 connection 3306 1200 connection ...
0
votes
2answers
51 views

Generating random passwords with shell on server deployment

I'm trying to generate random and secure passwords to my various configuration files and settings on the fly when I run my automated deployment script. I want them to be generated, shown to the user, ...
0
votes
0answers
41 views

ProFtpd with ssl and jailed users that cannot login to bash

I've followed several instruction pages and tutorials about configuring ProFtpd on Ubuntu (12.04) and they all give me "one thing works while other don't" solutions. Goal is to utilize SFTP protocol ...
0
votes
0answers
30 views

Elevated privileges for non-modifiable install script

I need to give permission to a local user to run an installation script that requires root privilege. So I created a special group in which this user is a member of and gave the permissions to the ...
0
votes
0answers
27 views

different interactive and non-interactive shells

A user account has it's shell defined in passwd file as bash. I would like to change this user account's shell to tcsh for non-interactive jobs (like ssh ), but keep interactive shell to bash. Is ...
-1
votes
1answer
83 views

Login by ssh , change the remote PS1 and don't quit the remote ssh shell [closed]

I want to change PS1 when i ssh another centos strshell = 'PS1="remote!"' os.system("ssh -i %s -l%s -p%s %s %s"%(SSH_KEY,SSH_USER,SSH_PORT,des,strshell)) ssh quit automatically. I want to ...
0
votes
2answers
48 views

How do I capture the Maven Jar name as a part of a Hudson job?

I have a Maven 3 job configured in my Hudson server. When the Hudson server successfully builds the Maven jar, I have the jar being deployed to an SCP repository on another server. I want to execute ...
-2
votes
1answer
147 views

Crontab not working to send email [closed]

I have CentOs 6.5 running on a VPS Host. I installed crontab and email using the below commands yum install vixie-cron service start crond chkconfig crond --levels 235 on yum install sendmail ...
1
vote
0answers
145 views

SSH without invoking shell

I've managed to mess up some shared libraries on my system, and now my shell cannot be run, thus locking me out of the system. Both ssh, sftp, and scp, as configured on the remote system, seem to rely ...
-1
votes
1answer
143 views

How to access a system with write permission after file system check fails?

I created three new partitions, but after a reboot, the system is being dropped to a shell: /dev/mapper/group-newpartition: clean, 11/655360 files, 276620/2621440 blocks [FAILED] An error occurred ...
-2
votes
1answer
29 views

zsh substitution, can't do regex with repetition

I'm trying to perform ZSH variable substitution, but I'm having to do it the lame way, by piping through cut. Is it possible to perform this operation entirely within ZSH? ...
0
votes
1answer
123 views

Where is this bash shell alias being configured?

While logged in as root onto a CentOS 6.5 system, I run ># alias alias cp='cp -i' alias l.='ls -d .* --color=auto' alias ll='ls -l --color=auto' alias ls='ls --color=auto' alias mv='mv -i' alias ...
0
votes
1answer
47 views

chattr: undefined symbol: set_com_err_gettext

I've moved my CentOS 6.5 installation to a new server and I'm unable to use chattr on my new server: chattr: symbol lookup error: chattr: undefined symbol: set_com_err_gettext How to resolve this ? ...
0
votes
2answers
581 views

Can't run AWS CLI from CRON (credentials)

Trying to run a simple AWS CLI backup script. It loops through lines in an include file, backs those paths up to S3, and dumps output to a log file. When I run this command directly, it runs without ...
0
votes
1answer
220 views

How to prevent syslog message popping in a ssh session without affect other sessions?

i have a machine(RHEL 5.2) which receives syslog message from remote machines. And now it keeps popping message from remote machine in a ssh shell, which is annoying when i want to do something on it. ...
0
votes
0answers
67 views

Distributing Master node ssh key

For the master node to passwordless-ly ssh into the slaves, the master needs to distribute its ssh key to the slaves. Copying key using ssh-copy-id asks for the user password. If there are hundreds of ...
2
votes
3answers
95 views

Can I use Bash interpreter in service/daemon scripts?

I'm writing a Debian/Ubuntu service that should start on at runlevel 2-5. Most of the existing services I came accross are written using /bin/sh (Shell) interpreter while /bin/bash (Bash) offer lot ...
2
votes
3answers
93 views

Common login script

Few weeks ago I thought it would be a good idea to write a script which should send me an email whenever some user would log in into my server. So I came to a perfectly working script ...
0
votes
7answers
213 views

better way to loop through a list of servers

I regularly do things where I loop through a list of servers to take some action. For example: for s in `cat servers.txt` ; do echo; echo $s ssh $s 'do something' done I'm wondering (from a ...
0
votes
1answer
104 views

Shell script won't run ruby script file

My shell script (my_shell.sh) won't run the ruby script ("ruby_script_1.rb) in it. my_shell.sh #!/bin/sh # Invoke the ruby script here ./ruby_script_1.rb It could not find where the ...
0
votes
1answer
66 views

Bash function hangs while command run perfectly without function

Following function hangs : ssh() { local RESULTS; RESULTS=$(ssh $USERNAME@$SERVER $SSH_COMMAND1); echo $RESULTS; } ssh; while if i run following commands they work fine : ...
0
votes
2answers
90 views

Access local console via SSH

I am searching for a way to interact with a local console via SSH - just as you would do with an directly connected keyboard. In my particular case I got a debian server (console only, no X system) ...
0
votes
0answers
24 views

Ctrl-C is ignored by pppd when put in a shell script

I'm trying to connect to GPRS network through a serial port connected GSM modem. When I call /usr/sbin/pppd call <peer_name> from the command line, It correctly receives and handles Ctrl+C from ...