SSH (Secure SHell) is a protocol for running commands on a remote computer.

learn more… | top users | synonyms

7
votes
1answer
1k views

Must an X11 server be installed for X11 forwarding over ssh to work?

I would expect that my local X11 server and sshd X11 forwarding turned on is all that is needed for X11 over ssh to work, but I haven't been able to get it. Am I wrong about this? Does the remote ...
7
votes
3answers
4k views

Disable colours on terminal and SSH

My local Linux machine has coloured terminal output like this; When I SSH to a pfSense/BSD box it changes the colours like this; Even when I SSH from to a machine that doesn't have a coloured ...
7
votes
1answer
449 views

self-recovering ssh tunnel over non-100% connection

I want to setup permanent ssh-tunnel for port forwarding to machine behind firewall. The connection is between university network (very reliable) and commercial microwave metropolitan connection to a ...
7
votes
4answers
1k views

How to add an ip range to known_hosts?

Many services (like GitHub) use a wide range of IPs, and obviously the same public key. How can I add an IP range (preferably in a single) to known_hosts file? For the GitHub example, it uses the ...
7
votes
1answer
3k views

SSH causes while loop to stop

I have finally managed to boil down a problem I have been struggling with for a few weeks. I use SSH with "authorized keys" to run commands remotely. All is fine except when I do it in a while loop. ...
7
votes
1answer
704 views

What steps does the system go through when handling an SSH connection?

What steps does the system go through when handling an SSH connection? We try to log in via ssh sshd starts pam and pam module to authenticate us Depending on pam configuration, we need to provide ...
7
votes
2answers
303 views

Use keyboard-interactive authentication when piping ssh output to other command

I'd like to pipe the output of ssh to a different command. For example: ssh myserver cat remote-file | diff local-file - The problem is that myserver asks for a password, but I can't enter it. (For ...
7
votes
1answer
6k views

Switch VI to use backspace key instead of Control+H for backspace?

I'm on Solaris 10 and by default vi version SVR4.0, Solaris 2.5.0 is installed. The system was set up so that when I ssh to it Control+H does backspace, and backspace outputs ^? I added stty erase ...
7
votes
2answers
21k views

How to add a ssh user who only has permissions to access specific folder?

How to add an ssh user who only has permissions to access specific folder? useradd -d /var/www/xyz.com.tr/musteri -s /bin/bash -g sshd musteri I created a user called musteri. I set its home ...
7
votes
1answer
167 views

Managing and applying custom updates to multiple identical machines [duplicate]

I work at a library where we have just recently setup 5 kiosk's based on linuxmint. The hardware is identical. I actually used DD to make an image after I set the first one up. My Problem is, I now ...
7
votes
4answers
1k views

How to set up two-factor authentication with OTP on FreeBSD?

I have a FreeBSD hosted server that I like to be able to get to from anywhere. Normally I use SSH publickey to log in, or if I don't have my SSH private key available then I might use regular password ...
7
votes
4answers
5k views

How can I set up smart card SSH authentication?

I would like to be able to SSH to my machine using a Gemalto .NET Smart Card as the authentication method. How could this be done on a Fedora 13 (or generic Red Hat style) machine? These are the ...
7
votes
2answers
2k views

Configuring ssh fingerprints on dns to replace known_hosts fails

The SSHFP records were generated on the ssh server as follows and then added to the zone in bind: $ ssh-keygen -r www.test.us. www.test.us. IN SSHFP 1 1 ad04dfaf343a93beeb939eed1612168f7eadbed7 ...
7
votes
1answer
2k views

How to use ssh-agent with multiple (valid) keys and yet choose which one to use?

Let's say there are two keys A and B, both of which are valid for user@host public key authentication. Since authorized_keys is configured for different behaviour depending on the key, ~/.ssh/config ...
7
votes
1answer
1k views

SSH not terminated after exit when there is X Forward program

After running X programs over SSH, SSH doesn't terminate after shell exit (have to use e.g. CtrlC to kill it). My guess is although the X program already exit, there is still some "connection" left ...
7
votes
1answer
2k views

Nested ssh session inside screen has no color

I am attempting to keep a nested ssh session inside of a byobu/screen window, which I also connect to over SSH with Putty on Windows. However the nested SSH session has no color. Here's what I'm ...
7
votes
3answers
14k views

ssh, start a specific shell, and run a command on the remote machine?

I am in a situation where several users are sharing the same user account on a remote machine. I have a "personal" directory where I wrote my own .zshrc file, and I would like to have a way to: ...
7
votes
3answers
372 views

OpenSSH - map aliases in ~/.ssh/config to IP addresses in command line

Is it possible to query ~/.ssh/config in the command line? Let's say I would like to retrieve what IP address does the particular alias point to in a separate program, is it possible?
6
votes
4answers
17k views

ssh Connection refused: how to troubleshoot?

I'm trying: $ ssh eric@myserver where myserver is a machine in the intranet. I can ping myserver or respond to HTTP on port 8080, etc, but when I try ssh, I get ssh: connect to host myserver port ...
6
votes
4answers
38k views

Keeping a process running after putty or terminal has been closed [duplicate]

I'm running a node.js server off of a raspbian (Debian) machine, and I'd like to start and stop the server remotely. This for me means using putty to access the shell, except when I close out of the ...
6
votes
4answers
379 views

SSH “sleeping” for a long time before connect? [duplicate]

Possible Duplicate: How to speed my too-slow ssh login? I have a very strange issue with my SSH server. Whenever I attempt to connect, it literally waits about 30 seconds to a minute before ...
6
votes
1answer
2k views

Use different username by default for a specific host

I have a different (assigned, non-changable) username on one of the servers I log to regularly, and I would like to avoid writing it down every time. Can I make these lines [tohecz@localhost ~]$ ssh ...
6
votes
3answers
487 views

Remote ls on multiple machines

I want to connect to multiple machines specified in a file and perform 'ls' there. That's what I've come up with: for machine in $(cat machines) do echo "Connecting to " $machine ssh $machine ...
6
votes
5answers
2k views

How to effectively use screen and SSH?

I'd like to configure SSH and screen such that a login will always reattach to a screen session. Ideally, that session would not quit but detach when I press C-d. How can this be achieved? And what ...
6
votes
2answers
1k views

How can I make ssh ignore .ssh/config?

I have the following in my ~/.ssh/config. HOST 10.2.192.* USER foo PreferredAuthentications publickey IdentityFile ~/.ssh/foo/id_rsa The above configuration lets me connect ...
6
votes
3answers
15k views

How to write a bash script, that logs onto an other machine to do stuff?

Is it possible to write a bash script, that would be started from machine A, logs in on a different machine B by ssh (both machines A and B would be Linux-Machines), copys some files on to machine B ...
6
votes
5answers
441 views

Use two different ip addresses per host in SSH

I have a server, named gamma, constantly up and running at work. Sometimes I connect to it from at home, in which case I use the public IP address 55.22.33.99. Sometimes, I connect to it when I'm at ...
6
votes
3answers
1k views

Is there any disadvantage in using SSHFS instead of SSH alone?

I find it easier to use SSHFS to mount a remote file system on my local computer instead of plainly SSH'ing into the remote computer. This saves me from using all the complicated scp commmands for ...
6
votes
3answers
17k views

How to pull a file from a server using scp?

I am on machine A and want to pull a file from machine B. A$ scp <myuserid>@hostB:<path of file in B> . it says that: scp: <path of file in B>: No such file or directory But on ...
6
votes
3answers
479 views

Pass my credentials from a ssh session to another ssh session

I want to ssh from A to B, using a particular private key that I have in A. Then I want to ssh from B to C using the same credentials that I used to ssh into B. Is it possible to "pass" the ...
6
votes
1answer
494 views

Why ssh does not turn terminal title back?

As you might know, when you ssh to a server from an X terminal (rxvt, gnome-terminal...), ssh changes the window title to reflect user@host, but it does not change it back. There are many tips how to ...
6
votes
2answers
544 views

Is it possible to use one SSH key per account for each account on a given remote server?

Suppose I have a number of accounts on a server called SERVER. Let's call them ACCOUNT1, ACCOUNT2 and ACCOUNT3. Suppose I don't want to have to type in the password for the account each time I ssh ...
6
votes
2answers
1k views

Should I be backing up my SSH host keys?

In my automated backups, I'm not sure if I should be doing this. If the hard drive fails or if I wipe the hard disk and start over, what will be the effect of starting with a new SSH host key to my ...
6
votes
2answers
672 views

Special character '#' in Perl SSH command

I try to send command using SSH in my perl script with # but it gets truncated right at # Example: Input text is : $message = "Product ID # STK000134" The SSH command is : $execute=`ssh -q ...
6
votes
1answer
3k views

SSH over Socks proxy without username or password

I have a list of SOCKS proxy servers from this site. I've read about creating a dynamic tunnels with ssh -D and to be honest i've tried that already. Unfortunately for some reason I cannot connect to ...
6
votes
3answers
3k views

Are there disadvantages in SSH tunneling?

I recently "bought" a VPS that I want to use as a Proxy to be able to use some sites and stuff that I can't reach from germany. Since I was yet too lazy to set up Squid and OpenVPN (which I ...
6
votes
4answers
2k views

History of IP addresses that accesed a server via ssh

It has come to my attention that a server of mine has been hacked and infected with a known chinese botnet. It was a prototype/testing virtual machine with its own static IP(US address) so no harm ...
6
votes
4answers
2k views

SSH authentication: either SSH keys or one time password

I have an Ubuntu 10.04 Linux server that I normally ssh into (from my home machine) using ssh key authentication. However, sometimes I need to ssh remotely from potentially insecure machines (like ...
6
votes
2answers
777 views

Is it possible to break long lines in sshd_config?

Specifically AllowUsers parameter: e.g. convert this AllowUsers user1 user2 user3 user4 to this AllowUsers user1 user2 user3 user4
6
votes
1answer
93 views

Cannot run cryptsetup throught SSH?

I'm trying to open a LUKS drive through SSH directly. ssh root@XX "cryptsetup luksOpen /dev/sdb3 secure But, no password prompt and it stuck. debug1: Sending command: cryptsetup luksOpen /dev/sdb3 ...
6
votes
2answers
266 views

annoying message “X11 connection rejected because of wrong authentication” while there is no problem at all

I'm having an annoying problem. When I'm logged in to a specific host via SSH, the message X11 connection rejected because of wrong authentication. occurs three times seemingly random about once ...
6
votes
2answers
949 views

How can I forward a already forwarded ssh key into tmux?

I'm connecting through SSH from a machine where my keys are stored, forwarding to a second machine, and then try to use the keys from within tmux. I appear to "loose" the forwarding when entering ...
6
votes
2answers
735 views

Why not simply use %h in OpenSSH ssh's ControlPath option?

Why do the "ssh_config(5)" manpages recommend that the ControlPath option should contain at least the %h, %p and %r placeholders in order to uniquely identify each shared connection? I thought that ...
6
votes
3answers
3k views

ssh to private-ip

I have a computer with CentOS (computer A) that configured as has an private ip 10.150.5.141 (with restricted firewall), can access internet and my ArchLinux VPS (computer B) with real ip w.x.y.z How ...
6
votes
1answer
2k views

How to safely resume an aptitude dist-upgrade after SSH timeout?

I started aptitude dist-upgrade over SSH on my local network. At some point the session timed out but the upgrade was not finished (it was left at one of those accept software agreement screens-- I ...
6
votes
3answers
541 views

Send an email any time an SSH key is used

I have about 30 nearly-identical CentOS 6 servers that I need to be able to push out updated config files automatically using an rsa key to log in as root. Usually this will just be rsync, but ...
6
votes
2answers
1k views

SSH LocalCommand on exit

In ~/.ssh/config you can use the LocalCommand directive to execute a local command whenever you connect to a remote machine via SSH. But how do I execute a command when I exit an SSH connection? It ...
6
votes
2answers
2k views

Can I set my local machine's terminal colors to use those of the machine I ssh into?

I have a color scheme that I like for when I'm in a terminal, but I ssh into the machine I work on from multiple sources (locally, PuTTY, my netbook, etc.) and I want to maintain the same color scheme ...
6
votes
4answers
1k views

Why do I need to hit enter to get my shell prompt after my init.d script completes?

I had to write my own CentOS init.d script for celery because it only ships with one for Debian. You can see the script I wrote when I answered my own stack overflow question 3989656. But there's a ...
6
votes
1answer
213 views

ssh from linux into mac - permission denied

I'm running a Oracle Linux VM on a Windows 7 host and I'm trying to ssh into my MacBook. I've already created the private/pub keys in my Mac. I have copied the id_rsa.pub contents into the ...