Skip to main content

All Questions

Tagged with
0 votes
0 answers
35 views

Set terminal color without having bash history look wrong? [duplicate]

A site suggested I wrote the below to set the color of my terminal in `~/.bashrc export PS1=`printf "\033[32m$ \033[39m"` If I log in through ssh, press up, home, up text will be garbled. ...
Andrew Spar's user avatar
2 votes
0 answers
282 views

Detect SFTP Login And Perform A Web Request

I am running a SFTP server on Linux/Debian. What I want is to detect when a user connects to the Server and then execute a bash script on the server in which I perform a web request. In this web ...
sposti88's user avatar
0 votes
1 answer
2k views

Debian 10 over SSH ignoring `DEBIAN_FRONTEND=noninteractive`

I am writing some scripts in order to install some things on a server running Debian 10. This is the script: #!/usr/bin/env sh address=$1 ssh -T $address <<EOF > /dev/null ...
KNejad's user avatar
  • 565
5 votes
1 answer
3k views

SSH not passing LANG environment variable

I'm running a Debian server (uname -v output #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23)). When I log in from any of several clients (macOS 10.13 laptop with default ssh, the "Prompt" app on iOS, among ...
Scott Colby's user avatar
0 votes
2 answers
1k views

Bash: Failing to Capture Exit Code of Command executed Remotely via SSH

I am using OpenSSH and have the following bash script, named foo, on Debian 8 (Jessie) Linux: #!/bin/bash ssh [email protected] "$1" if [[ $? ]]; then echo "Pass" else echo "Fail" fi I am ...
Dave's user avatar
  • 1,049
1 vote
1 answer
593 views

SSH - Ignoring $PS1 in .bashrc

Relevant file contents: http://pastebin.com/6VtWcaWG Everything else including the aliases and the PATH variable are fine, but when I log in as root on my remote machine, the correct $PS1 (set in the ...
Thisguy_'s user avatar
7 votes
3 answers
40k views

Execute a script as root on every ssh login

Is there a possible way that I can execute a script, say abc.sh; as root user on every login to my system via SSH? I've gone through a similar question which says to add the script execution to ....
hjpotter92's user avatar
0 votes
1 answer
190 views

Bash terminal lacking functionality when running as non-root

I'm running a command-line Debian system, accessed via SSH through PuTTY, and am experiencing differing terminal functionality between root and other users. When logging in as root, the terminal ...
FarmerGedden's user avatar
133 votes
8 answers
1.1m views

How can I resolve the error "cannot execute binary file"?

When I login using SSH, all I can see is this... -bash: /usr/bin/id: cannot execute binary file -bash: [: : integer expression expected I couldn't do anything in here. Commands such as halt, ...
superuser's user avatar
  • 4,117
1 vote
1 answer
1k views

managing ssh command in a bash loop

i've done a bash script like this while read site address do ssh $address "df -k" done to repeat the remote command few times, but the loop works just once. Any idea on the reason of this behavior?...
user83102's user avatar