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
4.8m views

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
1.3m views

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

I'm working from the URL I found here: http://web.archive.org/web/20160404025901/http://jaybyjayfresh.com/2009/02/04/logging-in-without-a-password-certificates-ssh/ My ssh client is Ubuntu 64 bit 11....
Thom's user avatar
  • 7,845
674 votes
12 answers
806k views

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
525k views

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
1.5m views

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
366k views

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
528k views

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
459k views

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
522k views

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
391k views

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
194k views

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 XXX.YYY.com User my_username Compression yes Ciphers arcfour,...
Amelio Vazquez-Reina's user avatar
301 votes
2 answers
191k views

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
323k views

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
401k views

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
449k views

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
579k views

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

When I open this ssh tunnel: ssh -nXNT -p 22 localhost -L 0.0.0.0:8984:remote:8983 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
1.2m views

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 123.123.123.123 Unable to negotiate with 123.123.123.123 port 22: no matching key exchange method ...
 j1088099.mvrht.com.'s user avatar
260 votes
7 answers
739k views

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
373k views

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
319k views

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
457k views

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
163k views

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
256k views

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
250k views

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
57k views

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
152k views

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
403k views

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
267k views

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
123k views

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
553k views

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
55k views

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
124k views

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
745k views

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
165k views

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
143k views

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
533k views

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
39k views

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
50k views

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
150k views

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
647k views

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
242k views

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
680k views

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
279k views

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
160k views

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
672k views

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
110k views

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
195k views

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
321k views

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
155k views

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
215k views

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

1
2 3 4 5
161