ssh

how to run a command in background using ssh and detach the session

I'm currently trying to ssh into a remote machine and run a script, then leave the node with the script running. Below is my script. However, when it runs, the script is successfully run on the machine but ssh session hangs. What's the problem? Thanks ahead. ssh -x $username@$node 'rm -rf statuslist mkdir statu...

Secure Alternative to "wget --mirror"

I'm looking for a secure alternative to doing something like this, wget --mirror --preserve-permissions --directory-prefix=/hdd2/website-backups --exclude-directories=special,stats --ftp-user=user --ftp-password=pass ftp://ftp.domain.com It's executed via cron. The "--mirror" switch in that is important to me. ...

ssh with command....Plus the shell

Hi, I'd like a command that ssh'es into a machine, runs a command (cd or execute a script or su), and then gives me the shell. Passing a command to ssh seems to always exit. Some examples of what I'm looking for: 'ssh me@machine1 "./executeMyScript && cd /developmentDirectory"' and then it gives me my shell back. The reasons I want to...

How do I copy data from a remote system without using ssh or FTP Perl modules?

I have to write a Perl script to automatically copy data from remote server to my local system. The directory structure on remote systems is: ../log/D1/<date>.tar.gz ../log/D2/<date>.gz ../log/D3/<date>.tar.gz ../log/D4/<date> and same on other server. I want to copy the data on local system in below format. ../log/S1/D1/<date>.tar.g...

Help Please...How to control any IR based home applience using iphone? will it require SSH/UPnP based application for iphone?

Hi, I want to use ssh protocol. I want to make an app to transmit signal that would ultimately converted to control IR based home appliences (like controlled by IR remote control. i.e TV) This stuff is new to me. I don't have any clear understanding about how it will be possible. I got suggession to use SSH : ->Install SSH on your se...

Accessing Subversion repository with 2 hops using svn+ssh protocol

My ubuntu subversion server is not directly accesible to the internet, 192.168.1.2 My public ubuntu machine is exposed through the dmz at 192.168.1.1 i setup port forwarding from 192.168.1.1:3906 to 192.168.1.2:3906,but i have no idea how this would work with svn+ssh since one extra hop is required to reach my subversion server EDIT: ...

Php : running ssh from Windows to login to a Linux and run a script

Hi ! Here's my goal : I have a Windows XP PC with all the source code in it and a development database. Let's call it "pc.dev.XP". I have a destination computer that runs Linux. Let's call it "pc.demo.Linux". Here's what I've done on "pc.dev.XP" (just so you get the context) : installed all cygwin stuff created a valid rsa key and p...

How to sudo on a computer using ssh inside a bash script

I'm trying to run a bash script that has: ssh -l <username> <compname> 'sudo yum -y install expect' I get the error: sudo: sorry, you must have a tty to run sudo on some computers but on others the process runs smooth. How can I prevent this? ...

SSH on Linux: Disabling host key checking for hosts on local subnet (known_hosts)

I work on a network where the systems at an ip address will change frequently. They are moved on and off the workbench and DHCP determines the IP they get. It doesn't seem straightforward how to disable host key caching/checking so that I don't have to edit ~/.ssh/known_hosts every time I need to connect to a system. I don't care ab...

How do I ensure that a username/password combination is not read from memory

How do I ensure that a username/password combination is not read from memory while my application is in use. My program is a GUI wrapper for some CYGWIN tools, including SSH and SCP. I need to ensure single sign-on capabilities to a variety of hosts. ...

Is it possible to have Perl run shell script aliases?

Is it possible to have a Perl script run shell aliases? I am running into a situation where we've got a Perl module I don't have access to modify and one of the things it does is logs into multiple servers via SSH to run some commands remotely. Sadly some of the systems (which I also don't have access to modify) have a buggy SSH server t...

How do I use ssh from emacs?

Hello, I normally connect to another server using the terminal using: ssh [email protected] However, I have been using emacs a lot now, and I am wondering if I can connect to a remote Red Hat server from within emacs? Many thanks for any suggestions, ...

Accessing SSH key from bash script running via a cron job

I've put this script together to updated a folder of forked Github repositories on a daily basis. It runs fine if I call it from a prompt, but I can' figure out how to make it utilize my id_rsa reliably when it is run as a cron job. the eval 'ssh-agent' is an attempt to do just that, but it doesn't seen to have any positive affect. #!/b...

Simple SSH Tunnel in Java

I want to create an SSH Tunnel in Java. I noticed quite a few Java SSH libraries on another post. Before I dig into each option, maybe someone can give me some code snippets of how they did it or at least tell me which client library would work best. I only need tunneling. I won't need stuff like file transfers, terminal emulation, e...

vim screen restore

Hi, i use vim in screen for development and if i quit vim, the current screen-content stays there... outside the screen (xterm), exiting vim will restore the previous buffer (like: [ server1 ]~$ cmd some stuff, some stuff [ server1 ]~$ cmd [ server1 ]~$ cmd ) But not inside screen. I tried to use xterm as terminal inside scr...

How to programatically transfer files when there is "FTP Over ssh"

I am doing projects on ftp. On my client side they have ssh. Until now I done application without ssh, I don't know how to transfer files over ftp when there is ssh over it. I want to do it in C# 2.0. How to do it? Any information regarding this will be very helpful. ...

Key based authenication with net-sftp in Ruby

Hello, I want to be able to use SFTP to login into a number of servers and download certain files to help debug issues as and when they arise. While we could use a client, we wanted to start automating the process to streamline everything. My first attempt looks something like this: def download(files_to_download, destination_directo...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository directory and associated metadata: svn co svn+ssh://[email protected]/path/to/repository Several developers work on the same working copy that...

how to use ping in a script

I want a bash script that'll do: for c in computers: do ping $c if ping is sucessfull: ssh $c 'check something' done If I only do ssh and the computer is iresponsive, it takes forever for the timeout. So I was thinking of using the output of ping to see if the computer is alive or not. How do I do that? Other ideas will be...

How to run, monitor and stop a PHP script using SSH on a shared webserver?

Can a normal member (not an admin) of a shared webserver with (limited) SSH access run, monitor and stop a PHP script through SSH? If so, how would all three actions be done by the user? I tried to use the command "top", but it only listed actual top level processes, not PHP scripts. I have also managed to start a PHP script using the...