Questions tagged [ssh]

GENERAL SSH SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com. Secure Shell (SSH) is a cryptographic network protocol for secure data communication. Use this tag for programming questions related to Secure Shell. Common authentication and configuration problems are off-topic for Stack Overflow.

Filter by
Sorted by
Tagged with
3264 votes
13 answers
3.0m views

How do I copy a folder from remote to local using scp?

How do I copy a folder from remote to local host using scp? I use ssh to log in to my server. Then, I would like to copy the remote folder foo to local /home/user/Desktop. How do I achieve this?
  • 32.9k
2937 votes
35 answers
2.4m views

ssh "permissions are too open"

I get the following error from ssh: Permissions 0777 for '/Users/username/.ssh/id_rsa' are too open. It is recommended that your private key files are NOT accessible by others. This private key will ...
2133 votes
41 answers
2.0m views

Could not open a connection to your authentication agent

I am running into this error of: $ git push heroku master Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts. ! Your key with fingerprint b7:fd:15:...
1664 votes
39 answers
1.7m views

How to specify the private SSH-key to use when executing shell command on Git?

A rather unusual situation perhaps, but I want to specify a private SSH-key to use when executing a shell (git) command from the local computer. Basically like this: git clone git@github.com:TheUser/...
  • 24.3k
1475 votes
10 answers
641k views

How do I remove the passphrase for the SSH key without having to create a new key?

I set a passphrase when creating a new SSH key on my laptop. But, as I realise now, this is quite painful when you are trying to commit (Git and SVN) to a remote location over SSH many times in an ...
1384 votes
23 answers
1.5m views

How to use SSH to run a local shell script on a remote machine?

I have to run a local shell script (windows/Linux) on a remote machine. I have SSH configured on both machine A and B. My script is on machine A which will run some of my code on a remote machine, ...
user avatar
1116 votes
21 answers
658k views

Best way to use multiple SSH private keys on one client [closed]

I want to use multiple private keys to connect to different servers or different portions of the same server (my uses are system administration of server, administration of Git, and normal Git usage ...
  • 11.2k
1054 votes
16 answers
762k views

Calculate RSA key fingerprint

I need to do the SSH key audit for GitHub, but I am not sure how do find my RSA key fingerprint. I originally followed a guide to generate an SSH key on Linux. What is the command I need to enter to ...
  • 12.5k
1006 votes
62 answers
1.8m views

Git: How to solve Permission denied (publickey) error when using Git?

I'm on Mac Snow Leopard and I just installed git. I just tried git clone git@thechaw.com:cakebook.git but that gives me this error: Initialized empty Git repository in `/Users/username/Documents/...
  • 26.9k
984 votes
30 answers
937k views

ssh remote host identification has changed [closed]

I've reinstalled my server and I am getting these messages: [user@hostname ~]$ ssh root@pong @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS ...
948 votes
43 answers
658k views

"UNPROTECTED PRIVATE KEY FILE!" Error using SSH into Amazon EC2 Instance (AWS) [closed]

I've created a new linux instance on Amazon EC2, and as part of that downloaded the .pem file to allow me to SSH in. When I tried to ssh with: ssh -i myfile.pem <public dns> I got: @@@@@@@@@@@@@...
  • 26.1k
887 votes
24 answers
1.6m views

How do I access my SSH public key?

I've just generated my RSA key pair, and I wanted to add that key to GitHub. I tried cd id_rsa.pub and id_rsa.pub, but no luck. How can I access my SSH public key?
  • 55k
790 votes
33 answers
836k views

SSH Key - Still asking for password and passphrase

I've been somewhat 'putting up' with Github always asking for my username and password when I clone a repository. I want to bypass this step because it is an annoyance within my workflow. I tried ...
  • 10.7k
748 votes
4 answers
2.0m views

How to download a file from server using SSH? [closed]

I need to download a file from server to my desktop. (UBUNTU 10.04) I don't have a web access to the server, just ssh. If it helps, my OS is Mac OS X and iTerm 2 as a terminal.
  • 13.5k
659 votes
15 answers
583k views

How to SSH to a VirtualBox guest externally through a host? [closed]

I have a Ubuntu VM running on my Windows 7 machine. How do I set it up so that I can access the webserver externally through SSH? I found steps (Setup SSH access between VirtualBox Host and Guest VMs)...
  • 8,984
628 votes
36 answers
658k views

mysql_config not found when installing mysqldb python interface

I am trying to get a Python script to run on the linux server I'm connected to via ssh. The script uses mysqldb. I have all the other components I need, but when I try to install mySQLdb via ...
  • 6,785
615 votes
13 answers
547k views

How to permanently add a private key with ssh-add on Ubuntu? [closed]

I have a private key protected with a password to access a server via SSH. I have 2 linux (ubuntu 10.04) machines and the behavior of ssh-add command is different in both of them. In one machine, ...
  • 9,854
579 votes
25 answers
651k views

SSH Key: “Permissions 0644 for 'id_rsa.pub' are too open.” on mac

I generate a ssh key pair on my mac and add the public key to my ubuntu server(in fact, it is a virtual machine on my mac),but when I try to login the ubuntu server,it says: @@@@@@@@@@@@@@@@@@@@@@@@@@...
  • 5,895
525 votes
24 answers
567k views

Change key pair for ec2 instance

How do I change the key pair for my ec2 instance in AWS management console? I can stop the instance, I can create new key pair, but I don't see any link to modify the instance's key pair.
  • 5,358
523 votes
32 answers
719k views

Adding a public key to ~/.ssh/authorized_keys does not log me in automatically

I added the public SSH key to the authorized_keys file. ssh localhost should log me in without asking for the password. I did that and tried typing ssh localhost, but it still asks me to type in the ...
  • 16.7k
497 votes
19 answers
378k views

Specify an SSH key for git push for a given domain

I have the following use case: I would like to be able to push to git@git.company.com:gitolite-admin using the private key of user gitolite-admin, while I want to push to git@git.company.com:some_repo ...
  • 16k
496 votes
11 answers
312k views

Is it possible to specify a different ssh port when using rsync?

I have been attempting the following command: rsync -rvz --progress --remove-sent-files ./dir user@host:2222/path SSH is running on port 2222, but rsync still tries to use port 22 and then ...
  • 5,928
491 votes
4 answers
749k views

Transferring files over SSH [closed]

I'm SSHing into a remote server on the command line, and trying to copy a directory onto my local machine with the scp command. However, the remote server returns this "usage" message: [Stewart:...
user avatar
484 votes
15 answers
432k views

scp (secure copy) to ec2 instance without password

I have an EC2 instance running (FreeBSD 9 AMI ami-8cce3fe5), and I can ssh into it using my amazon-created key file without password prompt, no problem. However, when I want to copy a file to the ...
  • 38.2k
460 votes
9 answers
646k views

Pseudo-terminal will not be allocated because stdin is not a terminal

I am trying to write a shell script that creates some directories on a remote server and then uses scp to copy files from my local machine onto the remote. Here's what I have so far: ssh -t user@...
  • 12.8k
460 votes
5 answers
184k views

.bashrc at ssh login

When I ssh into my ubuntu-box running Hardy 8.04, the environment variables in my .bashrc are not set. If I do a source .bashrc, the variables are properly set, and all is well. How come .bashrc isn'...
  • 15.2k
453 votes
7 answers
224k views

Why does GitHub recommend HTTPS over SSH?

On the GitHub site there is a link... https://help.github.com/articles/generating-ssh-keys ... and it states... If you have decided not to use the recommended HTTPS method, we can use SSH keys ...
450 votes
31 answers
796k views

Git error: "Host Key Verification Failed" when connecting to remote repository

I am trying to connect to a remote Git repository that resides on my web server and clone it to my machine. I am using the following format for my command: git clone ssh://username@domain.example/...
  • 4,611
441 votes
14 answers
499k views

What is the cleanest way to ssh and run multiple commands in Bash?

I already have an ssh agent set up, and I can run commands on an external server in Bash script doing stuff like: ssh blah_server "ls; pwd;" Now, what I'd really like to do is run a lot of ...
  • 36.1k
427 votes
3 answers
393k views

Copying files using rsync from remote server to local machine

Once I've ssh'd into my remote server, what would the command be to copy all files from a directory to a local directory on my machine?
  • 9,117
426 votes
49 answers
312k views

Vagrant stuck connection timeout retrying

My vagrant was working perfectly fine last night. I've just turned the PC on, hit vagrant up, and this is what I get: ==> default: Clearing any previously set network interfaces... ==> default: ...
  • 10.6k
424 votes
6 answers
322k views

How do I verify/check/test/validate my SSH passphrase?

I think I forgot the passphrase for my SSH key, but I have a hunch what it might be. How do I check if I'm right?
  • 27.8k
411 votes
6 answers
314k views

Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058"

When I try to start the ssh-agent on Windows 10 via PowerShell (with elevated right or without) by entering Start-Service ssh-agent I get the error unable to start ssh-agent service, error :1058 ...
  • 9,661
407 votes
5 answers
373k views

Keep SSH session alive [closed]

I use ssh -p8520 username@remote_host to login remote server. Issue: It is always connected and works properly when I am in the work place. Unfortunately, terminal freezes in 10 - 15 minutes after I ...
407 votes
9 answers
386k views

git remote add with other SSH port

In Git, how can I add a remote origin server when my host uses a different SSH port? git remote add origin ssh://user@host/srv/git/example
  • 23.4k
398 votes
12 answers
388k views

Start ssh-agent on login [closed]

I have a site as a remote Git repo pulling from Bitbucket.com using an SSH alias. I can manually start the ssh-agent on my server but I have to do this every time I login via SSH. I manually start ...
389 votes
24 answers
165k views

Is it possible to create a remote repo on GitHub from the CLI without opening browser?

I created a new local Git repository: ~$ mkdir projectname ~$ cd projectname ~$ git init ~$ touch file1 ~$ git add file1 ~$ git commit -m 'first commit' Is there any git command to create a new ...
  • 9,883
362 votes
29 answers
574k views

ssh: connect to host github.com port 22: Connection timed out

I am under a proxy and I am pushing in to git successfully for quite a while. Now I am not able to push into git all of a sudden. I have set the RSA key and the proxy and double checked them, with no ...
356 votes
17 answers
168k views

SSH to Elastic Beanstalk instance

I just signed up for Amazon's new Elastic Beanstalk offering. What I can't figure out is how to SSH to a Beanstalk instance. I don't have a private key because Beanstalk generated the instance on my ...
355 votes
29 answers
702k views

Permission denied (publickey) when SSH Access to Amazon EC2 instance [closed]

I want to use my Amazon ec2 instance but faced the following error: Permission denied (publickey). I have created my key pair and downloaded .pem file. Given: chmod 600 pem file. ...
  • 10.8k
355 votes
19 answers
363k views

Getting ssh to execute a command in the background on target machine

This is a follow-on question to the How do you use ssh in a shell script? question. If I want to execute a command on the remote machine that runs in the background on that machine, how do I get the ...
  • 5,615
330 votes
6 answers
222k views

SSH configuration: override the default username [closed]

Is it possible to configure ssh to know what my username should be? By default it uses the current username, which is not correct in my case. I'm on a loaner laptop, and my username is loaner, but I ...
  • 37.2k
327 votes
13 answers
248k views

Delete newline in Vim

Is there a way to delete the newline at the end of a line in Vim, so that the next line is appended to the current line? For example: Evaluator<T>(): _bestPos(){ } I'd like to put this ...
  • 17.5k
327 votes
8 answers
344k views

How do I get git to default to ssh and not https for new repositories

These days when I create a new repository on GitHub on the setup page I get: git remote add origin https://github.com/nikhilbhardwaj/abc.git git push -u origin master And whenever I have to push a ...
  • 8,765
318 votes
15 answers
258k views

How can I ssh directly to a particular directory?

I often have to login to one of several servers and go to one of several directories on those machines. Currently I do something of this sort: localhost ~]$ ssh somehost Welcome to somehost! ...
  • 5,993
311 votes
13 answers
141k views

Multiple GitHub Accounts & SSH Config

I'm having some trouble getting two different SSH keys/GitHub accounts to play well together. I have the following setup: Repos accessible from one account using git@github.com:accountname Repos ...
  • 5,754
306 votes
20 answers
241k views

How to prevent a background process from being stopped after closing SSH client in Linux [closed]

I'm working on a Linux machine through SSH (Putty). I need to leave a process running during the night, so I thought I could do that by starting the process in background (with an ampersand at the end ...
  • 39.2k
303 votes
18 answers
175k views

Repository access denied. access via a deployment key is read-only

After successfully cloning my repo from heroku and added another remote 1/ git clone git@heroku.com:[APP].git 2/ git remote add bitbucket ssh://git@bitbucket.org/[ACCOUNT]/[REPO].git 3/ git push ...
  • 12.1k
292 votes
25 answers
228k views

'heroku' does not appear to be a git repository

When I try to push my app to Heroku I get this response: fatal: 'heroku' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct ...
  • 3,151
283 votes
24 answers
296k views

How to solve "sign_and_send_pubkey: signing failed: agent refused operation"?

Configuring a new Digital Ocean droplet with SSH keys. When I run ssh-copy-id this is what I get: ssh-copy-id user@012.345.67.89 /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), ...
  • 3,991

1
2 3 4 5
591