-1
votes
0answers
27 views

Rsync resume with Expect script after Broken pipe on remote server

I am trying to resume the RYSNC automatically with the expect script, but I keep getting error as I am not able to get into the expect script at all to enter the pwd My expect is installed in ...
0
votes
0answers
39 views

Shell Script automatically exits from SSH section after switching of user (through pbrun command)

I have the below piece of code.. ssh some_user@server << EOF echo 'Successfully connected to the server' pbrun previlige -u user ls pwd id ...few more commands EOF if [ $? -eq 0 ] then echo ...
0
votes
1answer
21 views

Open an ssh session and pass a password on login

In the place where I live the internet connection basically works as follows: You have to configure your network interface to use a unique private ip and the organizations servers as gateway, which ...
0
votes
1answer
24 views

socat as argument to ssh: “bash: socat: command not found”

If I ssh into an osx box from a linux box, issuing socat works fine. However, if I give the socat command as argument to ssh it fails. socat was installed in osx using brew. Any idea why this is ...
2
votes
2answers
58 views

what is `ssh-agent bin/bash` and why I have to `ssh-add` everytime

I have to run the following commands each time I restart: ssh-agent /bin/bash ssh-add ~/.ssh/key_rsa First question is why is /bin/bash necessary and what it is used for? Second, Is it ok I run ...
2
votes
2answers
109 views

Bash / exit status is 0, while expected is 255

Have a code I've used for the tests hola="cd /var && ssh localhost.error" $hola echo $? Executing just cd /var && ssh localhost.error will return code 255. But executing ...
1
vote
2answers
64 views

Transfer file via SSH from server back to client

I am logged to remote server via ssh (linux) or via putty(windows). I want to copy file back to my origin machine from remote bash prompt (because of convenience). I know I can launch FileZilla or ...
0
votes
3answers
105 views

Time Zone is getting different over ssh command & normal ssh

Whenever I run a date command over SSH the timezone shows different and if I login to server with SSH and if I run the same command it is completely different. Running command with SSH >ssh ...
0
votes
0answers
9 views

CygWin shortcut to launch server, connect and start a program

I have miraculously only spent about 20 minutes getting an installation of cygwin to communicate with a remote box that I use for controlling my CNC machine. At this point, to get everything running ...
0
votes
1answer
45 views

Using GNU screen to create a split screen environment from command line

Could someone please point me towards the syntax for using GNU screen from the command line. On a previous cluster, I managed to create a bash script that would create X number of tiled shells, each ...
1
vote
2answers
43 views

Run a script post login linux

I would like to run a script after a linux user logs in to do some additional security checks. The user should first login normally using their password, but then be checked with my script, and then ...
2
votes
4answers
113 views

Detecting known computer on public network in BASH

Anybody know of a way through BASH (specifically OSX terminal, but I'd prefer a BASH only solution without OSX' in built functionality) to detect a known computer on a public network (that I am also ...
1
vote
4answers
519 views

Shell script: ssh to remote machine, then exit: 'exit' does not work

I have a shell script of the following type: #!/bin/bash ssh mylogin@myremotemachine.com echo "Hi" exit I run it locally to do something on a remote server (represented by 'echo "Hi"'). However, ...
1
vote
1answer
36 views

What's the relationship between ssh console and bash?

This is somewhat a Grandma question, but nevertheless, I can't really figure it out. It's the following: I log in to a remote machine via ssh. There (for example!) I try to set LD_LIBRARY_PATH ...
0
votes
1answer
47 views

using git pull after ssh in script

I use public and private key to ssh to a remote server without password. After that, I need to perform "git pull" command. But I don't know how to pass the password into it. Trying the following ...
0
votes
1answer
33 views

How do I make sure that bash (not tcsh) is used in Linux?

I have a bash script where I use ssh to connect to another server and run some commands there. I found some sites that the error (Warning: no access to tty (Bad file descriptor). Thus no job control ...
0
votes
0answers
85 views

shell script over SSH ends unexpectedly after running 'ant build'

I wrote a shell script that runs on remote host to build source code with 'ant build' command, and then distribute the built binary to other servers. However, right after Ant build is over ...
0
votes
1answer
30 views

How to print index in a 'for-loop' being executed in remote host through SSH?

I want to ssh into a remote host, and then execute a for loop that goes through sequence of numbers to control number of different nodes. ssh user@host /bin/bash << EOF for i in {1..10} do echo ...
2
votes
3answers
67 views

Why is this sudo command try to run in /root?

I try to run a sudo command via SSH like this: ssh domain.com sudo -u user bash -c "cd /home/user/ && ls" (which is obiously just an example). I get back: /home/user/: line 0: cd: /root: ...
0
votes
1answer
30 views

ssh to production to www-data user

I build an automation for deploys, that we connect to our productions servers and then perform a git pull in the project. The project is owned by "www-data" so I need to to --> ssh ...
0
votes
5answers
49 views

History in bashrc on login vs manual sourcing - clearing and loading

I use a bunch of different aix machines at work and need to share users with co-workers. To make my life easier but not bother others with my customizations, I have created a .bashrc file that I copy ...
0
votes
1answer
41 views

Bash script via ssh does not have $PATH

I'm trying to run bash script via ssh. To do this I run command: ssh me@server 'bash -s ' < script.sh The problem is that when I run script like this I don't have my $PATH variable (i.e. if I ...
1
vote
1answer
52 views

How to work with Windows through Linux?

I have to work with some remote Windows machines in a project, I also need to check for logs and find fixes for some bugs and things like that. But honestly, I don't like to use Windows to do this ...
1
vote
2answers
28 views

SSH Alias prompts passcode authentication but direct SSH works

I'm trying to SSH into a server on which I have sshd running (let's call it me@server). I set up ssh keys by using ssh-keygen -t rsa to create the key and then I ran cat ~/.rsa/id_rsa.pub | ssh ...
0
votes
3answers
24 views

How to run a bash on a server in background?

I want to run a bash script on a server in background? I know I can use ssh to run a script, but the script may last for a long time, so can I run it in background? If so, how to do this?
1
vote
1answer
43 views

Run sed as a one-off ssh command

I would like to substitute a string with another in a file on a server of mine. I've tried doing this: ssh $REMOTE_HOST sed 's|export ${KEY}=${VAL}|export ${KEY}=${NEW_VAL}|' "$ENV_FILE" And a ...
0
votes
2answers
184 views

PuTTY remote command containing while loop

I am attempting to automate several common tasks that I SSH into a remote server to do. For this, I am using PuTTY and its "remote command" option (Connection > SSH) in several saved sessions. My ...
1
vote
2answers
73 views

Is it possible to combine these two ssh commands into one?

I'm using bash on Mac 10.9.1. Right now, I execute these two commands to ultimately get to the server I want access to ssh me@intermediate and then once logged in, I execute ssh me@destination ...
0
votes
0answers
53 views

Bash Script Display Remote Screen Session to User

I'm kind of new to bash scripting and I'm having trouble figuring out how to accomplish this. I'm working on a script that is designed to backup and manage a java application that runs within a ...
0
votes
1answer
39 views

end child process on network timeout

I have a .NET program (Edit: using MONO), call it myfoo that resides on my remote ubuntu server. To access it, I ssh into my box (using wifi, not ethernet). My bash shell starts up as normal, I cd ...
1
vote
2answers
62 views

SSH TERM detection

My ssh config file has accept env set as: AcceptEnv LANG LC_* I am a bit confused how when I ssh through some clients my TERM variable is set as xterm256-color, and other clients TERM is set as ...
0
votes
0answers
40 views

How to detect the OS type of a SSH client from the remote OS

If I am using PuTTY from Windows to SSH to a remote OS, how do I detect what OS the SSH client is running on, from within the remote OS? I think this is probably impossible. Merely the terminal type ...
1
vote
1answer
159 views

How do I change the .bash_history file location?

I'm running CentOS 6.x and want to move the .bash_history to a different location. The home directories of my users are (because I run a VPS) in /var/www/vhost/<domain>.<tld> which is FTP ...
0
votes
1answer
71 views

Linux Bash SSH - Why won't my port forwarding tunnel command work?

The commands I'm trying are: ssh -vxNn -L 8080:192.168.x.xx:80 hostname@server ssh -vxNn -L 8080:192.168.x.xx:80 hostname@server Where the "x" is masked for security as is the hostname and server, ...
1
vote
1answer
156 views

sequential SSH command execution not working in Ubuntu/Bash

My requirement is I will have a set of commands that needs to be executed in a text file. My Shell script has to read each command, execute and store the results in a separate file. Here is the ...
0
votes
0answers
35 views

Connecting to ssh and using screen not working properly

I used once ssh -t <login@server> screen -R to connect to a server and everything worked fine. I used the terminal in the server to execute an script and then detach the screen. I came back ...
3
votes
1answer
167 views

Why does my .bashrc get read when I run noninteractive commands over ssh

I've prepended each of my bash config files (~/.bashrc,~/.bash_profile,~/.profile) with echo NAME_OF_FILE, i.e. I get '.bashrc' when I source in ~/.bashrc. What baffles me is why I get and ...
1
vote
1answer
86 views

SSH hang at the end of one command

Below command is not coming out : ssh -x -l root asr-bng-ubuntu "/usr/local/sbin/radiusd" But process is getting started when i checked in console. Able to execute same ...
0
votes
1answer
116 views

Running a script from ssh, logging out and continuing the script

The overall question here is - how do I automate sshing into a machine, running a script, and exiting without killing the script? I know that this has been answered several times, but I'm not having ...
1
vote
1answer
438 views

SSH setting a timeout for the 'password' prompt?

Is there an SSH option (similar to -o ConnectTimeout=$seconds) that limits the time that it spends waiting at a password: prompt? Note, I do use keypairs for passwordless ssh, but I still wind up ...
1
vote
3answers
76 views

start program via SSH as different user

Problem description: there are two Macs, #2 one logged in with exampleuser and #1 I am logged in as admin. exampleuser doesn't have SSH rights at all, as it isn't an administrator. admin has full ...
0
votes
1answer
289 views

How do you run a command as another user on Linux?

I have access to a linux server where I can sudo to 'foo' like this without a password: sudo su - foo Once I am the 'foo' user I am able to run a script like this: /dir/foo_user_script.sh The ...
1
vote
2answers
2k views

ssh without password from a bash script

I am writing a bash script that should start a serf agent(http://www.serfdom.io/intro/index.html) on a remote machine via ssh. I have set up rsa keys using... ssh-key-gen -t rsa -b 4096 ssh-copy-id ...
0
votes
1answer
34 views

Live CD: Script doens't work correctly after login

I have a PXE/NFS Server (192.168.1.10), a client PC and a diskless PC. I installed base ubuntu 12.04 to client PC. I wrote this script (update.sh) to work after login to client PC. ...
0
votes
2answers
29 views

How to delete Exported folder (SSH)

I have used command: export TMPDIR=$HOME/tmp Now it created /tmp folder in my root directory (root/tmp) How can i delete it?
0
votes
1answer
45 views

Bash provide options and pass variable on choice

Trying to give an option to users of an installer to chose either "Development" or "Stable". By default the installer does "git checkout 1.1.0", but I'm turning 1.1.0 into $GIT_VERSION and trying to ...
2
votes
4answers
96 views

Manage a few Linux servers at once

I have a small cluster that consists of a few Linux nodes. There's a shared NFS, and I have the same user account with shared SSH keys on all nodes, but other than that each node has it's-own file ...
1
vote
1answer
145 views

break: only meaningful in a `for', `while', or `until' loop

Troubleshooting a error output at the end of a script. This... # We now request that the user restarts their server... read -e -p "Restart your server now to complete the install (y/n)? " rsn ...
6
votes
3answers
2k views

Could not create directory '/var/empty/.ssh'

Every day, after several hours of use, anything using SSH will just randomly stop working. The only solution is for me to restart my machine, which fixes it until it randomly occurs again. > git ...
0
votes
1answer
37 views

Tell me, when script has finished

Some years ago I had a small script[1] called beep-forever which ringed the terminal bell for ever. Use case: I want to know if a script has finished: do-foo-which-lasts-ten-to-thirty-minutes.sh; ...