0
votes
2answers
45 views

Start-up / Reboot scripts for different users

I'm still trying to learn a little more about bash scripting and start-up / reboot, I have read about crontab @reboot and also just looking at other options but I just wondered if someone could maybe ...
1
vote
1answer
55 views

piping using ssh without having to relogin for every pipe

I have an ssh connection and I have to send some local files and output to the ssh server. I know I can do this using the following command tar zcf - stuff | ssh user@server 'tar zxf -' I would ...
0
votes
2answers
613 views

Run scripts automatically in server after ssh connection

how to run a script automatically in server soon after client system establish ssh connection with the server for ex: suppose a user will logon to my computer from another system(connected via lan) ...
0
votes
1answer
300 views

SSH - How to force execution of a script ( /etc/sshrc , ForceCommand, .. ? ) on login but still allow execution of the client's ~/.ssh/rc?

As far as i know upon SSH login the following files are executed [SERVER] /etc/environment [Client] ~/.ssh/environment -> can be locally overriden by "SSH_ENV" environment variable -> will ...
2
votes
1answer
8k views

Run a nohup command over SSH, then disconnect

I want to execute a script, start.sh on a remote server which runs this: nohup node server.js & Naively, I call SSH like this: ssh myserver <<EOF ./start.sh & EOF This starts the ...
0
votes
0answers
101 views

How to run a logon script one time when a new user logs on

I have an ssh server with multiple users, How to run a logon script one time when a user logs on, or until the user provides meaningful feedback? I have a user who needs to sign off on a document ...
1
vote
1answer
7k views

Run script at boot/startup in Ubuntu 12.04 x64 Server

I am trying to start the RoR application named fedena. What I generally do is SSH login as rootand hit these commands root@cloud:~# cd fedena root@cloud:~/fedena# script/server => Booting WEBrick ...
0
votes
1answer
226 views

how to use expect with bash

I Have created a shell script as given below.This script will login to a remote server as a normal user then switch to root user for creating a directory.The script is as given below. ssh -t ...
1
vote
1answer
365 views

How to keep X-Server running via 'ssh -Y' after closing shell?

my name is Chris and i have trouble to run a Python-Script on a Server. I try to run a Python Script, that makes use of the Python module wx, on a Server. Therefor i open a shell connect to the ...
0
votes
0answers
40 views

Can I store a password in a bash script? [duplicate]

Is there some way to store (for example hashed etc.) secured password in a script that will be used during connection to server? Storing password and username as clear text in code for me is quite ...
1
vote
0answers
70 views

How to detect “ghost” X sessions?

The trouble is that, sometimes, the X session stay open after that the user is disconnected (such as when the network link is disconnected) It occurs in many ways, such as via ltsp or via ...
1
vote
1answer
2k views

Script to establish SSH tunnel and then run another program that uses the tunnel

I am running a GUI app (Gnucash) that connects to a remote Postgres database via a secure shell session. I can use the SSH -L command to tunnel a local port and then separately run Gnucash and this ...
1
vote
1answer
119 views

Multiple Users Sending Input To The Same Server Running On My Ubuntu Server

I've just recently started hosting a Java based server on my Ubuntu Server. I've been learning how to setup everything and I've been feeling pretty good about it's setup. I currently start the ...
2
votes
2answers
135 views

scripts in ~/bin don't work when connecting through ssh

I have some script in my $HOME/bin folder. When I access my machine remotely I can't use them and I can't understand why. They work just fine when I'm in front of my remote computer. I think it might ...
4
votes
1answer
210 views

How to stop SSH filesystem from discarding root permissions after every command?

i have a small bash script that mounts my sshfs... problem is it ask for the server/host password for every mount... i have four mounts and i have to enter it every time for 4 times and its ...
22
votes
2answers
28k views

ssh: automatically accept keys

I've written this small utility script: for h in $SERVER_LIST; do ssh $h "uptime"; done When a new server is added to $SERVER_LIST, the script is stopped with: The authenticity of host ...
3
votes
2answers
2k views

How to automatically run commands on SSH connection?

I have some Amazon EC2 instances that run Ubuntu 10.04.1 LTS. Every time I connect to those instances I run a couple of simple commands, like a cd <repository>, a git status etc. How can I add ...
1
vote
2answers
3k views

Copy file to same directory with appended filename Via SSH Bash Script

How would I copy a batch of files into the same directory with an appended filename via SSH Bash Script? For example. /path/files/file /path/files/file-20120105 The trick is for it to be a one liner ...
2
votes
2answers
912 views

How to pass arguments in a script using gnome-terminal

As part of a script I have gnome-terminal -e "process involving another user" Once executed this line, I have to write in the terminal 3 times the password of this user. I wonder how can I automate ...
1
vote
1answer
250 views

Executing bash script for all users

I have setup-ed key based ssh authentication to all my hosts for root user. However, for example if i want to change the background of all the users (not the root user, different user account) how to ...
0
votes
1answer
441 views

What command can mount an SSH share and launch a file?

I have a file on another Ubuntu machine. I want to access it from my machine on my LAN. I don't want to go into Nautilus to mount the share first and then browse to the file. I want a command that ...
1
vote
3answers
4k views

SFTP upload script, there is no key

I need to upload a file to a server. The server uploads using SFTP. After authentication, any command execution is forbidden, so I cannot SSH directly in, I need to get directly into the SFTP ...
3
votes
2answers
6k views

Remotely run a command on a ssh-server with a script

I want to run a command on a ssh-server, but this command is determined by a script on my local machine. How do I do that? An example for clarity: I want to write a script here (foo.sh) that takes an ...
6
votes
3answers
6k views

Run (system) script on SSH login and/or logout

I'd like my OpenSSH server to start a script whenever a user logs in using SSH, ideally passing the host name or IP, as well as the user name. Additionally I'd like it to run a script, whenever a ...
1
vote
2answers
718 views

connecting and copying files with scp — ubuntu 10.04

I have a work computer. I have a home computer. I want to be able to share files between with scp, both our computers are behind routers, which assign a local ip. 198.168.0.* As well as knowing their ...