Questions tagged [ssh]

SSH (Secure SHell) is a protocol for securely running commands on a remote computer. Use this tag for questions about configuring, using and trouble-shooting SSH client and server software.

Filter by
Sorted by
Tagged with
1262 votes
13 answers

How to copy files from one machine to another using ssh

I am using a Linux (CentOS) machine, and I have already connected to another system using SSH. Now, my question is: How can I copy files from one system to another system? Suppose, in my environment, ...
user3021349's user avatar
  • 16.5k
728 votes
30 answers

Why am I still getting a password prompt with ssh with public key authentication?

I'm working from the URL I found here: My ssh client is Ubuntu 64 bit 11....
Thom's user avatar
  • 7,845
674 votes
12 answers

How to force ssh client to use only password auth?

If I use pubkey auth from e.g.: an Ubuntu 11.04 how can I set the ssh client to use only password auth to a server? (just needed because of testing passwords on a server, where I default log in with ...
LanceBaynes's user avatar
583 votes
7 answers

Scroll inside Screen, or Pause Output

I use screen for my command-line tasks while managing the servers where I work. I usually run small commands (mostly file-system tasks) but sometimes I run more extensive tasks (like DBA). The output ...
AeroCross's user avatar
  • 6,373
554 votes
14 answers

How to forward X over SSH to run graphics applications remotely?

I have a machine running Ubuntu which I SSH to from my Fedora 14 machine. I want to forward X from the Ubuntu machine back to Fedora so I can run graphical programs remotely. Both machines are on a ...
Mr. Shickadance's user avatar
483 votes
5 answers

How does reverse SSH tunneling work?

As I understand this, firewalls (assuming default settings) deny all incoming traffic that has no prior corresponding outgoing traffic. Based on Reversing an ssh connection and SSH Tunneling Made ...
Ali's user avatar
  • 5,311
439 votes
2 answers

How to list keys added to ssh-agent with ssh-add?

How and where can I check what keys have been added with ssh-add to my ssh-agent?
Patryk's user avatar
  • 14.1k
410 votes
4 answers

Specify identity file (id_rsa) with rsync

I need to make periodic backups of a directory on a remote server which is a virtual machine hosted by a research organisation. They mandate that access to VMs is through ssh keys, which is all good, ...
Jangari's user avatar
  • 4,518
349 votes
22 answers

How can I run ssh-add automatically, without a password prompt?

I want to communicate between several computers on my network (static Ethernet), through SSH. In order to do that I need to run ssh-add every time I log in on a specific machine. What can I do so it's ...
zdun8's user avatar
  • 3,657
330 votes
10 answers

Copy a file back to local system with ssh

If I'm logged in to a system via SSH, is there a way to copy a file back to my local system without firing up another terminal or screen session and doing scp or something similar or without doing SSH ...
Shawn J. Goff's user avatar
313 votes
6 answers

Multiple similar entries in ssh config

Say I want to configure my ssh options for 30 servers with the same setup in my .ssh config file: host XXX HostName User my_username Compression yes Ciphers arcfour,...
Amelio Vazquez-Reina's user avatar
301 votes
2 answers

What's ssh port forwarding and what's the difference between ssh local and remote port forwarding [duplicate]

I feel confused about ssh port forwarding and the difference between ssh local and remote port forwarding. Could you please explain them in detail and with examples? Thanks!
user2886717's user avatar
  • 3,389
299 votes
11 answers

Keep processes running after SSH session disconnects

I sometimes have long-running processes that I want to kick off before going home, so I create a SSH session to the server to start the process, but then I want to close my laptop and go home. Later, ...
λ Jonas Gorauskas's user avatar
299 votes
6 answers

How to avoid being asked passphrase each time I push to Bitbucket

I set up my ssh stuff with the help of this guide, and it used to work well (I could run hg push without being asked for a passphrase). What could have happened between then and now, considering that ...
tshepang's user avatar
  • 65.5k
296 votes
7 answers

What do options `ServerAliveInterval` and `ClientAliveInterval` in sshd_config do exactly?

I found this question, but I'm sorry I don't quite understand the settings on the two variables ServerAliveInterval and ClientAliveInterval mentioned in the accepted response. If my local server is ...
M. Tibbits's user avatar
  • 3,247
292 votes
29 answers

SSH tunneling error: "channel 1: open failed: administratively prohibited: open failed"

When I open this ssh tunnel: ssh -nXNT -p 22 localhost -L I get this error when trying to access the HTTP server running on localhost:8984: channel 1: open failed: ...
Neil's user avatar
  • 3,462
267 votes
5 answers

How to enable diffie-hellman-group1-sha1 key exchange on Debian 8.0?

I am unable to ssh to a server that asks for a diffie-hellman-group1-sha1 key exchange method: ssh Unable to negotiate with port 22: no matching key exchange method ...'s user avatar
260 votes
7 answers

List all connected SSH sessions?

I just SSH'd into root, and then SSH'd again into root on the same machine. So I have two windows open both SSH'd into root on my remote machine. From the shell, how can I see a list of these two ...
themirror's user avatar
  • 6,968
259 votes
9 answers

scp without replacing existing files in the destination

How do I copy an entire directory into a directory of the same name without replacing the content in the destination directory? (instead, I would like to add to the contents of the destination folder)
user avatar
238 votes
8 answers

Why do I need a tty to run sudo if I can sudo without a password?

I have configured sudo to run without a password, but when I try to ssh 'sudo Foo', I still get the error message sudo: sorry, you must have a tty to run sudo. Why does this happen and how can I work ...
merlin2011's user avatar
  • 3,925
222 votes
9 answers

ssh-add complains: Could not open a connection to your authentication agent

I've been trying to get ssh-add working on a RaspberryPi running Raspbian. I can start ssh-agent, when I do it gives the following output into the terminal: SSH_AUTH_SOCK=/tmp/ssh-06TcpPflMg58/...
Daniel Groves's user avatar
214 votes
9 answers

ssh-add is not persistent between reboots

I added a ssh key to the agent by: $ ssh-add ~/.ssh/id_rsa_mac Identity added: /Users/alex/.ssh/id_rsa_mac (/Users/alex/.ssh/id_rsa_mac) After a reboot the agent doesn't have this key added anymore: ...
Incerteza's user avatar
  • 2,671
208 votes
8 answers

Automated ssh-keygen without passphrase, how?

I would like to make an automated script that calls ssh-keygen and creates some pub/private keypairs that I will use later on. In principle everything works fine with.... ssh-keygen -b 2048 -t rsa -f ...
humanityANDpeace's user avatar
203 votes
5 answers

Is it possible to find out the hosts in the known_hosts file?

I would like to see what hosts are in my known_hosts file but it doesn't appear to be human readable. Is it possible to read it? More specifically there is a host that I can connect to via several ...
Colin Newell's user avatar
  • 2,133
194 votes
4 answers

Is your SSH password revealed when you attempt to connect to the wrong server?

When you accidentally attempt to connect to the wrong server with password credentials is it possible for the administrator to read and log the password you used?
vfclists's user avatar
  • 7,487
191 votes
9 answers

How can I disown a running process and associate it to a new screen shell?

I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back. One way I thought of doing that was to transfer its ownership to a screen shell, ...
levesque's user avatar
  • 3,795
180 votes
9 answers

What does the Broken pipe message mean in an SSH session?

Sometimes my SSH session disconnects with a Write failed: Broken pipe message. What does it mean? And how can I keep my session open? I know about screen, but that's not the answer I'm looking for. I ...
Peter Stuifzand's user avatar
178 votes
8 answers

Get SSH server key fingerprint

Is there a way to programmatically obtain a SSH server key fingerprint without authenticating to it? I'm trying ssh -v user@host false 2>&1 | grep "Server host key", but this hangs waiting for ...
loopbackbee's user avatar
  • 4,542
160 votes
9 answers

How do I remotely edit files via ssh?

I have to edit some files placed on some server I could reach via ssh. I would prefer to edit these files in customized vim on my workstation (I have not rights to change vim settings on remote ...
Loom's user avatar
  • 3,943
159 votes
2 answers

SSH Key Permissions chmod settings?

I need to use SSH on my machine to access my website and its databases (setting up a symbolic link- but I digress). Following problem I enter the command: ssh-keygen -t dsa To generate public/private ...
crissixpaul's user avatar
  • 1,691
141 votes
1 answer

Why eval the output of ssh-agent?

In order to run ssh-agent I have to use: eval $(ssh-agent) Why is it necessary to eval the output of ssh-agent? Why can't I just run it?
jx12345's user avatar
  • 1,620
139 votes
12 answers

How to rsync over ssh when directory names have spaces

I am trying to rsync from one server to another. The servers have the same directory structure but I am having trouble getting the remotes server to properly recognize the path name on the remote ...
PyNEwbie's user avatar
  • 1,569
136 votes
5 answers

How to ssh to remote server using a private key?

I have two servers. Both servers are in CentOS 5.6. I want to SSH from Server 1 to Server 2 using a private key I have (OpenSSH SSH-2 Private Key). I don't know how to do it over unix. But what I did ...
Aivan Monceller's user avatar
136 votes
10 answers

How can I keep my SSH sessions from freezing?

I have ServerAliveInterval and in case of few machines also ClientAliveInterval set to 540 in SSH client/server configuration files (I suppose setting it to more than that would not be a good idea). I ...
syntagma's user avatar
  • 12.3k
134 votes
13 answers

How can I tell what version of Linux I'm using?

Often times I will ssh into a new client's box to make changes to their website configuration without knowing much about the server configuration. I have seen a few ways to get information about the ...
cwd's user avatar
  • 45.2k
132 votes
6 answers

What is the right file permission for a .pem file to SSH and SCP

I have tried to SSH into my AWS Ubuntu server and copy the directory to my local machine. Throughout the process I experience different file permission errors (noted below). Is there one specific ...
George Jester's user avatar
132 votes
3 answers

Kill an unresponsive ssh session without closing the terminal

Is there a way to disconnect from an SSH session that has become unresponsive without killing the whole terminal? Specifically I'm using konsole, and the machine I'm working with sometimes hangs, but ...
Falmarri's user avatar
  • 13k
131 votes
5 answers

what's the purpose of ssh-agent?

I've read the official definition: ssh-agent is a program to hold private keys used for public key authentication (RSA, DSA, ECDSA). The idea is that ssh-agent is started in the beginning of an X-...
agent_smith's user avatar
  • 1,605
129 votes
3 answers

SSH: tunnel without shell on ssh server

I have to set up a tunnel between two hosts. For this I use ssh in this way: ssh -L MY_LOCAL_PORT:FOREIGN_ADDRESS:FOREIGN_PORT MYUSER@SSH_SERVER after that, I log in to my SSH_SERVER. How can I ...
Bau Miao's user avatar
  • 1,513
125 votes
3 answers

SSH login with clear text password as a parameter? [duplicate]

I need to login to a user that I've created on a remote host running Ubuntu. I can't use an ssh key because the ssh login will happen from a bash script ran within a server that I won't have access to ...
mmla's user avatar
  • 1,377
125 votes
5 answers

How to dd a remote disk using SSH on local machine and save to a local disk

How can I create a backup of a remote disk using SSH on my local machine and save it to a local disk? I've tried the following: ssh [email protected] "sudo dd if=/dev/sdX " | \ dd of=/home/...
Qu0rk's user avatar
  • 1,391
125 votes
12 answers

ssh_exchange_identification: read: Connection reset by peer

I am on OS X trying to ssh into a ubuntu 12.04 server. I was able to SSH in -- until abruptly stuff stopped working. I've read online to use the -v to debug this. Output is shown below. If I ssh into ...
bernie2436's user avatar
  • 6,625
123 votes
11 answers

Uploading directories with sftp?

I'm having some trouble uploading directories(which contain other directories a few levels deep) by sftp. I realize I could work around this by gzipping, but I don't see why that's necessary. Anyway, ...
Earlz's user avatar
  • 2,244
122 votes
7 answers

How to kill SSH session that was started with the -f option (run in background)

I'm pretty lost on this. From the man page: -f Requests ssh to go to background just before command execution. After starting SSH with the -f option, I have a working tunnel. But after I ...
MountainX's user avatar
  • 17.9k
120 votes
13 answers

ssh_exchange_identification: Connection closed by remote host (not using hosts.deny)

I'm not using hosts.allow or hosts.deny, furthermore SSH works from my windows-machine (same laptop, different hard drive) but not my Linux machine. ssh -vvv root@host -p port gives: OpenSSH_6.6, ...
Torxed's user avatar
  • 3,627
118 votes
10 answers

Is it possible to run ssh-copy-id on port other than 22?

I have a server with SSH running on a non-standard port. Instead of 22, it runs on 8129. To log in, I use: ssh -p 8129 hostname Now, whenever I need to set up a key for password-less login, I have ...
Milan Babuškov's user avatar
118 votes
7 answers

how to avoid ssh asking permission?

We are attempting to speed up the installation of oracle nodes for RAC installation. this requires that we get ssh installed and configured so that it doesn't prompt for a password. The problem is: ...
Nicolas de Fontenay's user avatar
118 votes
5 answers

Is there a command to list all open displays on a machine?

When SSH'd locally into my computer (don't ask, it's a workaround), I can't start graphical applications without running: export DISPLAY=:0.0 If I run this first and then run a graphical application,...
Naftuli Kay's user avatar
  • 39.5k
118 votes
2 answers

How does tcp-keepalive work in ssh?

I am trying to code a shell-script that uses a ssh-connection for doing "heartbeats". I want to terminate the client- and server-side of that connection after a certain timeout (after the connection ...
Nils's user avatar
  • 18.4k
115 votes
5 answers

ssh-add returns with: "Error connecting to agent: No such file or directory"

ssh-add alone is not working: Error connecting to agent: No such file or directory How should I use that tool?
Wong Jia Hau's user avatar
  • 1,269

2 3 4 5