ssh

How to determine current remote connection type? (rsh or ssh)

Hi all, I want to know if there is some methods to find out the current connection type to remote server (rsh or ssh?). Environment is Solaris 9, SuSE linux, csh. ...

Question about starting SSH tunnel using Python

I have ran into trouble while starting SSH tunnel from HTTP RPC server written in Python. There is a simple HTTP RPC server written in Python based on Python's BaseHTTPServer. As a part of one of the services I would like to start a SSH tunnel from the RPC server to a remote machine. I used os.system to start the SSH tunnel in the Pyth...

Visually distinguishing between local and remote Terminal sessions

I'm using Terminal under OS X quite extensively. I find quite annoying (and a bit dangerous, too) that my local and remote sessions look exactly the same in the Terminal. I'm wondering if it's possible - maybe through a bit of bash-programming - to clearly distinguish between local and remote sessions. A different background color would...

SSH Tunnel for Python MySQLdb connection

I tried creating a SSH tunnel using ssh -L 3306:localhost:22 <hostip> Then running my python script to connect via localhost conn = MySQLdb.connect(host'localhost', port=3306, user='bob', passwd='na', db='test') However, I receive the following error (2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql....

how to use Net::SSH::Perl with public keys?

I'm trying to use Net::SSH::Perl to connect using public keys with this code: my $ssh = Net::SSH::Perl->new($host, debug=>1) || die ...... I put the key in /root/.ssh/id_rsa and /root/.ssh/identity It seems that it's not trying to use the public key and instead trying to ask for a password: I get this output: localhost: Sent ke...

How can I programmatically detect ssh authentication types available?

I'd like to write a monitoring plugin that checks various hosts on my network to make sure that password or interactive SSH authentication is not enabled. That is, I need to write code that: Connects to an SSH port. Enumerates available authentication methods. Verifies that only key based authentication is possible. Methods using eit...

Perform commands over ssh with Python

I'm writing a script to automate some command line commands in Python. At the moment I'm doing calls thus: cmd = "some unix command" retcode = subprocess.call(cmd,shell=True) However I need to run some commands on a remote machine. Manually, I would log in using ssh and then run the commands. How would I automate this in Python? I nee...

Is it possible to develop for Android on Android?

Lately I've been doing a lot of web development on my Droid via ssh using the ConnectBot app and a few other apps for reference. I've also been doing a lot of Android development back home in eclipse, and I wondered: would it be possible to develop and test my android projects right on my phone? All I can do at the moment is either wri...

git clone heroku ssh permission denied..

I just bought a new computer and I am trying to clone my heroku project on it. Here's what I've done so far. I didn't include the trace, but everything was saved in the right place, and the functions ran without errors. >> sudo ssh-keygen >> heroku keys:add >> sudo git clone -o heroku [email protected]:myapp.git Initialized empty Git rep...

How to execute a command on the server with Capistrano?

I have a very simple task called update_feeds: desc "Update feeds" task :update_feeds do run "cd #{release_path}" run "script/console production" run "FeedEntry.update_all" end Whenever I try to run this task, I get the following message: [out :: mysite.com] sh: script/console: No such file or directory I figured it's because...

How to config mercurial to push without asking my password through ssh?

Hi guys, I use mercurial in my project, and every time I push new changesets to the server by ssh, it ask me for a password. Then how to config the mercurial to push with out asking password? I works on Ubuntu 9.10 ...

git remote add with other ssh port

in git, how I can add a remote origin when my host use a different ssh port? git remote add origin ssh://user@host/srv/git/example ...

Piping output from ssh back to the local shell

Is there a way, from ssh, to get output back to the shell ssh was invoked from, kind of like :! in vim? For example, say I'm grepping a file for 'bananas' on a remote server, and I want to copy the output to an IM window - is there a way to invoke pbcopy on my local machine, or am I stuck selecting/copying from the terminal window? In ...

How to setup PC and Mac for using git.

I use git both for Mac and PC. When pulling Mac's git from PC, it's easy as I can use ssh. git clone smcho@prosseek:~/smcho/setup The problem happens the other way round : to pull from Mac. I guess there are two ways to go. Method 1 : Connect to server By using 'connect to server' in Mac, I can make PC's directory like that of Mac....

ssh connection using RSA key keep asking password

I'm trying to set-up SSH connections without password to many servers, using RSA key. It works well for most of them but one is giving me some trouble. The most common issue I've found in the past is permissions problems on .ssh or authorized_keys on the remote host, but here they seem correct, like this: drwx------ ~/.ssh -rw-r--r-- ...

Need help with ssh script

Hi all, I'm very new with ssh so I need some help to write some scripts. The idea is I have files distributed in different folders on a remote server. I want to copy some certain folders into another new folder also on the same server. Suppose, I know all the name of folders that I want to copy and I can list them in a text file. How c...

How do clone a Mercurial repository into a directory that already exists?

Hello. I have a client's Django project that I'm developing locally, using Mercurial for version control. I push my local repository to my personal remote server (where I keep all my projects) and then when I come to deploy it (on whichever web server) I clone that respository there from my personal server. This works fine on most serv...

issue while ssh while using sshj in java

I am trying to get a remote connection to server to execute some commands. I am new to this so started googling. After some search, I gave a try: I am using sshj0.2.3.jar. And here is how I implemented it: public static void main(String[] args) throws IOException { // TODO Auto-generated method stub final SSHClient ssh = new S...

"Could not load known_hosts" exception using SSHJ

I am getting an exception while using SSHJ. Here is how I implemented it: public static void main(String[] args) throws IOException { // TODO Auto-generated method stub final SSHClient ssh = new SSHClient(); ssh.loadKnownHosts(); ssh.connect("serverName"); try{ ssh.authPublickey("myUserId"); f...

I'd like to run a command over ssh from a windows box running using c#

Note that this has to be on a windows box as I am using c# to access information about windows (I need information from both a windows box and a linux box, plus I think that making a program/script that runs without gui and accesses windows from a linux box without user intervention would be more difficult, if this is not true please te...