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

0
votes
0answers
18 views

PHP file execute shell command with continuous output [migrated]

Running shell commands from PHP is done like this: <?php $cmd = 'du /'; print shell_exec ( $cmd ); ?> Or <?php $cmd = 'du /'; passthru ( $cmd ); ?> However you only see the output ...
1
vote
3answers
39 views

How do i change the global login shell on a unix system?

I want to set the login shell (the shell they get when they log in) of all existing and future users. The correct way to change the login shell seems to be chsh. But this only allows me to change the ...
0
votes
0answers
33 views

Automatically starting C# Mono application on Ubuntu server

I have a TCP server written in C# which I will run on my server. I've tested the application running on the server and client side and it all works great! I'm using mono on my Linux server to run the ...
1
vote
0answers
43 views

Accidentally typed crontab with just the dash [migrated]

What happens when I type just "crontab -"? The "e" didn't take before I hit Enter. It just moved the cursor to the next line and I had to Ctrl+C to exit, but I'm not sure what it did exactly. I'm on ...
2
votes
2answers
31 views

ssh dissable login, but allow copy-id

I have a user that's only used for a proxy, so no one can login. #passwd file entry proxyuser:x:996:99::/home/proxyuser:/bin/false but, I'd like to enable ssh-copy-id to that user How do I do ...
-1
votes
0answers
16 views

rsync:How could I get the incremental files/dirs only in the result message?

I am not familiar to rsync, so could I get the incremental files/dirs only in the result message? I just get all files/dirs listed in the message, which are not changed at all. e.g., rsync -rvn ...
0
votes
4answers
79 views

cron job executing script [duplicate]

I have created a script that works as expected in shell but cron job does not seem to run it. when I check my cron mail, I see that it prints "hltv is not running" but does not create a screen ...
0
votes
2answers
32 views

Changing the mysql bind-address within a script

What would be the best way to change the mysql bind-address in the my.cnf from a shell script? Is there a way using a tool like mysqladmin or should I use sed or should I simply append it to the ...
1
vote
0answers
15 views

Setting tabstop for bash output [migrated]

Is it possible to set a tabstop (number of spaces per tab) for the more and less commands? In vi, I've added this line to .vimrc set tabstop=4 However when I read through a file with more it still ...
0
votes
2answers
33 views

Creating an environment variable for a specific user

When you set an environment variable in linux is it set only for the user who executes it, or can you specify a user when you store it, or instead is it always available for all users?
1
vote
2answers
52 views

Samba server: Who used all of our storage yesterday?

First day there is plenty of free storage space, next day someone used up all free space. Is there an efficient way to find out which directory has an increased storage use? I know how to find new ...
12
votes
4answers
464 views

How do I start a second shell when in single user mode?

This may sound like a contradiction in terms, but I've recently needed to use single user mode (aka maintenance mode) for some time (days!) while trying rebuild a broken RAID array. While doing this, ...
0
votes
1answer
35 views

Starting supervisor with init fails

I installed supervisor using pip on my debian 7 installation. I then grabbed this file and moved it here: /etc/init.d/supervisord https://github.com/Supervisor/initscripts/blob/master/debian-norrgard ...
2
votes
1answer
124 views

Bash: two commands in dollar-parenthesis don't have same behavior

I don't undertsand why, in Bash: echo $(hostname --fqdn) works, echo $(id -un) doesn't (id: –un: No such user). Backticks give the same results. Is there some good practice for using this ...
1
vote
3answers
133 views

how to make alias with quotes

I tried to make alias with quotes as following: alias myalias='ps -ef | grep tomcat | kill -9 `awk {'print $2'}`' but as you can see i already have ' in awk so i tried to replace awk {'print $2'} ...
0
votes
1answer
27 views

Connecting to server with remotely generated SSH key

I run a process on my server where I generate a public and private key. The public key I use for github. I was wondering, if I do a readout of the private key of the remote system, can I then save ...
-1
votes
3answers
71 views

What is default shell for users in /etc/passwd for Solaris 11?

For a Solaris 11 Server Config Review that I am doing, I have following lines in my /etc/passwd file: root:x:0:0:Super-User:/root:/usr/bin/bash daemon:x:1:1::/: bin:x:2:2::/usr/bin: sys:x:3:3::/: ...
0
votes
1answer
32 views

Trouble with $PATH on debian

I think I have a problem with $PATH. I am running a shell script and it is complaining that it doesnt recognize the command even though when I run it manually it does. Shell Script: #!/bin/bash # ...
-5
votes
1answer
31 views

How to update SASS for the whole of a VPS automatically? [closed]

I have a VPS with SASS, and I have configured it correctly. I have multiple users on my server, and they don't have SSL access to the server. Some of them use SASS, and I don't want to have to ...
1
vote
2answers
94 views

permission denied in running script

I am running a script but there is an unusual warning: This is what happened in my console #whoami root #ls -l test.sh -rwxr-xr-x. 1 root root 1894 Feb 2 01:58 test.sh* #./test.sh -bash: ./test.sh: ...
1
vote
0answers
42 views

EC2 - editing .bashrc causes terminal to hang and checks to fail

I've been testing this for the past few hours with no luck. When launching an Ubuntu 12.04 EC2 micro instance, I SSH to it, create a new user and continue with installing Ruby version manger under ...
0
votes
2answers
114 views

running a remote shell script that switches to a user does not return to the issuing local server shell

When I run a script such as this: ssh -t root@10.10.10.10 '/tmp/somescript.sh' where the script is defined as: #!/bin/sh mkdir -p /data/workday/cred chown -R myuser:myuser /data su myuser - # ...
0
votes
2answers
103 views

How to view and kill PHP processes?

I'm very new to using SSH and am having trouble finding a way to view and kill PHP processes that are running. When I say "PHP processes," I mean PHP files that were started through the browser, but ...
2
votes
2answers
46 views

Will locally mounting root filesystems of all remote servers being managed eliminate need to share dotfiles?

I've got about 10 remote servers being managed, through SSH, and I typically just SSH into each of them for remote management tasks. This requires me to have duplicated many of my dotfiles (like ...
0
votes
1answer
12 views

Unable to send command to newly created screen?

screen -dmS SIEGE_01 sleep 1 screen -S SIEGE_01 -X stuff "cd /home/ss12036/ImpulseNetwork/Servers/SIEGE_01/"`echo -ne '\015'` sleep 1 screen -S SIEGE_01 -X stuff "sh Start.sh"`echo -ne '\015'` ...
0
votes
0answers
9 views

different color for terminal's username prompt [duplicate]

[root@sv2-12 linux]# git status In the above line can I set [root@sv2-12 linux]# in different color, this will help in looking at the terminal bit easier way. I am using gnome-terminal in linux. ...
0
votes
1answer
43 views

Close putty connection from CentOS 6 shell script

as title says I have a centOS 6 machine which uses an dracut, initramfs preboot ssh. I want to create a shell script that at the end of it's execution it closes the console and ssh connection. How can ...
0
votes
1answer
47 views

Binary data in shell argument

Is there a way to safely encode / pass arguments to a shell command where the argument might be binary? I'm executing a command from within a PHP script that allows for user data. For security, ...
2
votes
4answers
146 views

Use logger in shell script

How can I use logger in a shell script? If I run ntpd -qnp pool.ntp.org 2> >(logger) in console, it works as expected. If I put it into a shell script #!/bin/sh ntpd -qnp pool.ntp.org ...
1
vote
3answers
117 views

How to parallelize the scp command?

I need to scp the files from machineB and machineC to machineA. I am running my below shell script from machineA. I have setup the ssh keys properly. If the files are not there in machineB, then it ...
0
votes
2answers
122 views

Gnu parallel & pipe

I want to send each line of a file to another program's stdin, e.g. input.txt line1 line2 line3 I want to use the gnu parallel like this (i.e. pipe each line as stdin to the more command) cat ...
1
vote
2answers
66 views

How do I iterate bash arrays and make an SCP command efficiently?

I need to scp the files from machineB and machineC to machineA. I am running my below shell script from machineA. I have setup the ssh keys properly. If the files are not there in machineB, then it ...
3
votes
0answers
70 views

Security Warning: Enable “Jail Apache” in the “Tweak Settings”? [closed]

I have VPS running WHM on CentOS 6.5 and I have root access. A security warning appearing in the Security Advisor. Warning: Enable “Jail Apache” in the “Tweak Settings” area. I entered the tweak ...
1
vote
1answer
27 views

How to generate a signature with a launchd plist? [closed]

Is it possible to implement the following shell script completely as a launchd plist to generate a signature with timestamp in the StandardErrorPath / StandardErrorPath files? #!/bin/sh echo "Hi, ...
0
votes
2answers
56 views

redirect command executed along with output shell

I would like to redirect the command executed along with the output to a file. for example: #ls >ls_out.txt ls_out.txt should be something like : ls file1 fil2 Thanks!
0
votes
2answers
31 views

best practice for setting PATH variable in nested user env

In my user environment I/(macports) have set my PATH to be in the form of PATH=app1/bin:app2/bin/:...:$PATH However if I have nested shells the PATH variable gets concatenated all the time, of ...
3
votes
3answers
275 views

Log commands executed over ssh

I would like to log all commands executed over SSH. Say, ssh something@server.com COMMAND I want to log "COMMAND" on server.com I did search extensively but could not find anything. There is ...
17
votes
3answers
651 views

How do I ssh on slow/flaky connections?

I am dealing with a really slow shell connection. It is in the cloud and I am very far from the server. My connection also breaks sometimes as it is over the internet and I may also be using shared ...
0
votes
2answers
72 views

How to regain an interactive shell that was disconnected via SSH?

Scenario: I am on windows, using putty to login to a root shell. It is currently running an interactive process which prompts for input to continue. Typical interactive process, its probably waiting ...
0
votes
1answer
130 views

Insserv rejected the script header

I was trying to make an init script for my debian install for supervisor. insserv: Service \$remote_fs has to be enabled to start service supervisor insserv: Service ...
-1
votes
2answers
70 views

Setting IPtables rules into a file

Currently I have a debian install with a shell script which has the following content (as an example): # Setup iptables IPT="/sbin/iptables" # Flush old rules, old custom tables $IPT --flush $IPT ...
0
votes
1answer
54 views

Installing PIP on debain - Unknown command pip

I'm having a bit of a hard time installing PIP on a debian linux machine. This is the code I am using in a shell script: # Install setuptools python -c 'import setuptools' > /dev/null 2>&1 ...
1
vote
1answer
30 views

cp/rsync command with destination as symlink to a directory

I am working on a cPanel backup solution at the moment. We are now informed about this exploit. Exploit : Full ROOT ACCESS to server 1.) create malicious file from, normal user account: mkdir root ...
2
votes
2answers
96 views

executing .bash_profile alias via SSH

I would like to remotely execute a .bash_profile alias, but I cannot find the proper command. I tried: ssh user@host "bash -ic myalias" but it doesn't work I get: bash: cannot set terminal process ...
1
vote
2answers
45 views

scp only files with defined extension

I want to transfer only files with special extensions (like only *.tar.gz, *.war) in one scp command (Debian Linux). Is this possible, if yes how is the syntax? Should be someting like: scp ...
2
votes
1answer
99 views

Despite #!/usr/bin/env php I need to call the file with php, why?

I'm trying to call the shell wrapper for phing phing ...but it doesn't recognize the env, I get a -bash: phing: command not found ...even though the file starts with: #!/usr/bin/env php ...
0
votes
1answer
373 views

Allow www-data to execute shell script

I have a shell script called boot.sh on an Ngnix server I am trying to call it via PHP, but I don't think I have permissions. How can I give www-data permission to run boot.sh - and only boot.sh ...
0
votes
1answer
74 views

Transfer used ram to swap and free more physical ram

I have a vps with 256m physical ram and 512m swap space, I am trying to use a software that need more than 256m and less than 512m ram, so it uses swap. The problem is at some moment of the ...
0
votes
1answer
26 views

cron to anacron migration process

I have a script that I want to run nightly on my lab's RHEL 5 and 6 workstations, so I'm deploying the script to each system's /etc/cron.daily/ directory and making it executable there. But some ...
2
votes
2answers
129 views

Shell access for a KVM VM

I would like to access my KVM VM with a shell. I created it via proxmox 2.3, Ubuntu 12.04 is installed on it via an official template. I would like to find the same command as vzctl enter ...