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

learn more… | top users | synonyms

8
votes
3answers
6k views

How can I track who SSH'es into my linux machine?

I'm running Ubuntu 10.04. Is there a way I can get a daily report of who has logged onto the box, what time, and even - this may be asking too much - a report of the commands they used? This is a ...
8
votes
1answer
1k views

How to detect when a shell is owned by a remote SSH session?

My question is similar to this one, but I'm looking for something slightly different. I have a notebook PC that I use to access Linux machines on a network in two different scenarios: I have a ...
8
votes
1answer
172 views

Does ssh-agent store my passphrase?

Is it possible to determine the passphrases of private keys added to ssh-agent? I'm thinking along the lines of someone with root privileges trying to find out my passphrase after I have added the ...
8
votes
2answers
2k views

How to restrict an SSH user to only allow SSH-tunneling?

How can I restrict a user on the ssh server to allow them only the priviledges for SSH TUNNELING? i.e. So they cannot run commands even if they log in via ssh. My Linux servers are Ubuntu 11.04 and ...
8
votes
4answers
477 views

Good practice to use same SSH keypair on multiple machines?

I recently got a new laptop for work, and I was wondering whether it'd be good practice to keep using the same RSA keypair as I'm using on my old work laptop. I'd really like to not have to create ...
8
votes
1answer
958 views

Bash autocomplete in ssh session

It seems that bash doesn't want to autocomplete commands (what's annoying me right now is not autocompleting apt-get) when I'm logged into my machine from SSH. Is there some setting that will allow ...
8
votes
2answers
2k views

How to efficiently use 3D via a remote connection?

I have one weak PC (client) but with acceptable 3D performance, and one strong PC (server) which should be capable of running an application using OpenGL twice, i.e. once locally and once remotely for ...
8
votes
1answer
452 views

How can I limit ssh *remote* port forwarding?

I need to limit which ports can be remotely 'ssh -R' forwarded by an user. I know about permitopen option on authorized_keys, but as it says on man page it only limits local 'ssh -L' port forwarding ...
8
votes
2answers
2k views

Get ssh to forward signals

I want to be able to send signals (SIGINT is the most important) through ssh. This command: ssh server "sleep 1000;echo f" > foo will start sleep on server and after 1000 seconds it will put ...
8
votes
2answers
148 views

Weird SSH issue, ssh works with -t but freezes without it

When I ssh into one of my servers, it seems to log in, but then hangs before giving me the prompt (message debug2: shell request accepted on channel 0 is the last log entry). Though the odd thing is ...
8
votes
4answers
758 views

Failing to block brute force ssh with iptables

I'm trying to block (slow down) brute force attacks on my sshd server. I'm following this guide http://www.rackaid.com/resources/how-to-block-ssh-brute-force-attacks/ which basically says I need to ...
7
votes
6answers
21k views

exit out of all SSH connections in one command and close PuTTY

Is there a way to back out of all SSH connections and close PuTTY in "one shot"? I work in Windows 7 and use PuTTY to SSH to various Linux hosts. An example of the way I find myself working: SSH to ...
7
votes
4answers
1k views

Is there a way to check a users SSH key to see if the passphrase is blank

I'm looking to lock down our Solaris 10, RHEL 5, and SLES 11.2 servers. It has come to my attention that some of the users have no passphrase for their SSH keys. Is there a way I can check for this ...
7
votes
3answers
10k views

ssh remote server on some port other than 22 without password

I am usually connecting to the remote server with ssh user@server.com -p 11000 and then giving the password each time for user. How should I avoid entering the password each time I connect ...
7
votes
3answers
560 views

Run a diff between local and remote file

I'm connected on a host via ssh and I'd like to compare (let's say with diff) a certain config file against its counterpart on another host, also accessible via ssh, without having to manually ...
7
votes
2answers
4k views

ssh port forward to access my home machine from anywhere

http://serverfault.com/questions/303937/how-to-make-freebsd-box-accessible-from-internet I want to understand this whole process of port forwarding. I read so many things but failing to understand ...
7
votes
3answers
8k views

How to check if I can log in to server via ssh?

I have a list of servers: cat list.txt 10.10.10.10 servera 10.11.10.10 serverb How can I check that I can log in via ssh to them or not? I mean by default I should be able to log in via ssh key ...
7
votes
1answer
1k views

Reusing ssh session for repeated rsync commands [duplicate]

Possible Duplicate: Using an already established SSH channel I have a remote server accessible via a chain of SSH proxies. The resulting channel is wide and fast enough, but setting it up ...
7
votes
2answers
361 views

Continue shell commands once connected to SSH

Not sure if the question I'm asking is correct but basically I wanted to automate this process scp ~/.ssh/id_rsa.pub username@example.com:~/ ssh username@example.com mkdir .ssh cat id_rsa.pub ...
7
votes
3answers
445 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 ...
7
votes
1answer
855 views

Given a private SSH key, how do I recover my public key?

I've somehow lost my id_rsa.pub file. I still have my id_rsa file. How do I recover the public key from the private key? (This question came up after ssh-copy-id was reporting "ERROR: No identities ...
7
votes
3answers
5k views

Redirect stdout over ssh

I would like to run something > file on a remote system through ssh, but if I run ssh host something > file the redirection is executed locally as ssh etc > file I've tried it with ' ...
7
votes
2answers
4k views

How can I set up SSH on Linux to log in password-less?

My Raspberry Pi is running the default Debian image and has SSH enabled. I log into my Pi as follows: ssh pi@<IP-address-of-my-Pi> I have to enter my password every time. Can I somehow make ...
7
votes
3answers
673 views

Prevent a unix account from being able to SSH [duplicate]

Possible Duplicate: Disable direct login for normal users (like oracle) in linux but allow scp and sftp? I want to prevent a unix account from being able to be SSH'ed with, but it should ...
7
votes
5answers
6k views

sh startup files over ssh

I have some important commands I need to execute before any sh shell starts. This is required for passing SSH commands in the SSH command (ssh host somecommand) and other programs that run commands. ...
7
votes
4answers
294 views

Stopping output from a program run in SSH session NOW

Problem I execute command that outputs LOTS of information through SSH. For example, I foolishly add debug information inside a loop that executes million times, or just run cat /dev/urandom for ...
7
votes
2answers
16k views

SSH key-based authentication: known_hosts vs authorized_keys

I read about setting up ssh keys in Linux and have some questions. Correct me if I'm wrong… Let's say host tr-lgto wants to connect to host tr-mdm using ssh. If we want to be sure that it's the real ...
7
votes
6answers
12k views

How to run commands in batch mode over ssh?

How can I run commands in batch mode over ssh? That is, what is the ssh command's equivalent of sftp -b <filename> <hostname>? I have a set of commands which I wish to run across a set of ...
7
votes
2answers
160 views

Stop ssh config on first match

I have a added a local proxy for all my hosts in my .ssh config, however I want to shell into my local vm without the proxy command. Output of my ssh attempt: debug1: /Users/bbarbour/.ssh/config ...
7
votes
1answer
26k views

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

I'm not using hosts.allow or hosts.deny, further more 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, ...
7
votes
4answers
5k views

Prevent SSH client passing TERM environment variable to server?

I'm currently using Fedora 18 gnome-terminal, then started tmux multiplexer in it. After I connected to a CentOS 5 server via ssh command, I find: ls result has no color tmux, screen, hexedit, htop ...
7
votes
3answers
3k views

Copying protected files between servers in one line?

I'd like to copy squid.conf from one server to another. The servers don't talk to each other. I'd like to go through my workstation. Both servers have the file, so it will be overwritten on the ...
7
votes
3answers
7k views

ssh prompts for password despite ssh-copy-id

I've been using public key authentication on a remote server for some time now for remote shell use as well as for sshfs mounts. After forcing a umount of my sshfs directory, I noticed that ssh began ...
7
votes
1answer
871 views

In which cases is SIGHUP not sent to a job when you log out?

I read an answer from a user who claimed that running foo 2>&1 >& output.log & would result in foo continuing to run even when they log out. According to this user, this even ...
7
votes
3answers
5k views

Give user permissions to all files and folders

I want to have a user who has access to all the files and folders on the system. This is for the purpose of using RSYNC on a local machine to backup a remote machine. At the moment we are using the ...
7
votes
3answers
3k views

how to ssh to remote server and use local emacs to edit files?

Is there a way to use the emacs installed my local computer to access remote files I have in a remote server? I have googled and found out that I should use TrampMode however it is necessary for me to ...
7
votes
1answer
932 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

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 login into my SSH_SERVER. How can I ...
7
votes
3answers
3k 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
431 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
1answer
691 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
3answers
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
1k views

Forward all ports SSH

I have a question about SSH/Port forwarding. I haven't found the solution anywhere and don't know if there is any. I have a server behind my NAT box at home. I have port forwarding from my NAT box to ...
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
1answer
164 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
1answer
250 views

stderr over ssh -t

This sends output to STDERR, but does not propagate Ctrl+C (i.e. Ctrl+C will kill ssh but not the remote sleep): $ ssh localhost 'sleep 100;echo foo ">&2"' This propagates Ctrl+C (i.e. ...
7
votes
2answers
1k 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
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 ...