Secure Shell (SSH) is a protocol primarily for encrypted shell connections. This tag is also used for questions about sshd and openssh, the two standard applications for using SSH.

learn more… | top users | synonyms (2)

9
votes
1answer
19k views

how to connect to mongodb server via ssh tunnel

It was easy for me to connect to my remote mysql server on AWS using a sequelpro, however I'm struggling with doing the same thing with mongodb. I tried setting up an ssh tunnel via command line ...
7
votes
1answer
4k views

How do I configure SSHd to permit a single command, without giving full login access to the user?

I am looking for best way to call remote command over SSH. I create user 'rpcall', generate new certificate and fill authorized_keys. Secure it little bit more with from="ip",no-agent-forwarding,no-...
5
votes
2answers
9k views

No TTY present when running commands over SSH in here-document

I'm trying to run a command over SSH like this in a here-document: ssh example.com <<END sudo /etc/init.d/apache2 reload END Which normally works except when I'm trying to run something that ...
6
votes
2answers
25k views

How to find my TeamViewer ID on SSH?

When I tried to run the command teamviewer --info I am getting the following output root@vps [~]# /opt/teamviewer8/tv_bin/TeamViewer --info TeamViewer 8.0.20931 teamviewerd ...
5
votes
6answers
1k views

Securing SSH on Linux Ubuntu

How can I secure SSH access to a linux box running Ubuntu k for multiple users? This server will be for a web app but I'm not sure how to evaluate the tools to perform this task. I have tried a few ...
4
votes
4answers
3k views

root locked out of EC2

I was in the process of disabling root logins on an AWS EC2 instance. Right after setting PermitRootLogin no and restarting sshd, I closed the terminal on accident -- before setting up users with sudo ...
2
votes
2answers
1k views

Re-gaining root access to an EC2 EBS-boot image

I'm using an Alestic image which disables root SSH logins, but provides a user "ubuntu" with NOPASSWD sudo privileges. See here. In the course of trying to add a new user to the sudoers file I ...
10
votes
5answers
50k views

SSH / SCP Server on Windows [duplicate]

Possible Duplicate: What is a good SSH server to use on Windows? Can anyone on the SF community recommend a trustworthy/easy to set up SCP server for windows. I do not want to go through the ...
3
votes
3answers
453 views

Block interactive SSH sessions while allowing certain commands

How would one only allow certain commands to be run via SSH and block interactive sessions? rsync.net does this as well as bakop.com. I.e. this would work: ssh <user@host> mkdir test scp <...
2
votes
2answers
2k views

Possibility of WAN Optimization for SSH traffic

While I do understand that SSH by itself is a very low bandwidth utilizing protocol, it is sometimes choking up bandwidth during peak hours in our office environment. I want to know if at all it is ...
62
votes
11answers
160k views

“Add correct host key in known_hosts” / multiple ssh host keys per hostname?

Trying to ssh into a computer I control, I'm getting the familiar message: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@...
93
votes
4answers
83k views

how to disable SSH login with password for some users?

On Linux (Debian Squeeze) I would like to disable SSH login using password to some users (selected group or all users except root). But I do not want to disable login using certificate for them. edit:...
142
votes
2answers
45k views

Create a public SSH key from the private key?

Let's suppose I have a SSH key, but I've deleted the public key part. I have the private key part. Is there some way I can regenerate the public key part?
38
votes
9answers
31k views

Allow SCP but not actual login using SSH

Is there any way to configure a user on a Linux box (Centos 5.2 in this case) so that they can use scp to retrieve files, but can't actually login to the server using SSH?
27
votes
2answers
21k views

SSH key authentication using LDAP

In short: Would like a way to do SSH key authentication via LDAP. Problem: We use LDAP (slapd) for directory services and we've recently moved to using our own AMI for building instances. The ...
32
votes
8answers
6k views

What are best practices for managing SSH keys in a team?

I work with small teams (<10) of developers and admins with the following characteristics: Most members of the team have >1 personal computer, most of which are portable Team members have access ...
25
votes
4answers
11k views

Centralized management system for SSH keys?

We are looking to switch to key-based management of SSH logins, and wonder if there any key-management systems which would allow us to centrally manage the access keys world-wide. The system should ...
40
votes
22answers
15k views

Why change default ssh port? [closed]

I've noticed that a lot of admins change the default ssh port. Is there any rational reason to do so?
20
votes
5answers
11k views

ssh tunneling only access

Is it possible to configure ssh (on linux) to allow access for tunneling only? Ie user can setup tunnels but cannot get a shell/access files?
39
votes
16answers
37k views

Why Block Port 22 Outbound?

I'm a programmer, and I have worked for a few clients whose networks block outgoing connections on port 22. Considering that programmers often need to use port 22 for ssh, this seems like a ...
14
votes
5answers
27k views

Using SSH to remotely start a process

I have written a script that I am using to push and deploy a new service to several machines under my control, and in order to execute the process I am using ssh to remotely start the process. ...
32
votes
6answers
32k views

protocol version mismatch — is your shell clean?

When following the instructions to do rsync backups given here: http://troy.jdmz.net/rsync/index.html I get the error "protocol version mismatch -- is your shell clean?" I read somewhere that I ...
13
votes
4answers
5k views

“Virtual hosts” for SSH [duplicate]

We have a remote Xen server running a lot of guest machines (on Linux), with only a couple of IPs available. Each guest machine should be directly accessible by the SSH from the outer world. Right ...
14
votes
7answers
59k views

Linux closing connection after successful login

I am working on a server with Debian 5.2.2. Barely having any administrative knowledge with Linux, I think I screwed something up. I used apt-get update and apt-get upgrade to get everything up to ...
9
votes
3answers
22k views

How to setup ssh tunnel to forward ssh?

I have computer with Ubuntu behind router that I can't configure. However I want to have ssh access to that computer. I think it is possible with ssh tunneling, but I don't know how to do it. I have ...
56
votes
5answers
7k views

I accidentaly forbid SSH connection to a remote server… What's next?

Let's say it again, we all make mistakes, and I have just made one. A brief history: I was doing some stuff on a VPS (Debian) I'm renting, when I noticed some strange behaviour. Using the netstat ...
30
votes
6answers
80k views

How to remove strict RSA key checking in SSH and what's the problem here?

I have a Linux server that whenever I connect it shows me the message that changed the SSH host key: $ ssh root@host1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: ...
8
votes
7answers
5k views

BASH shell session logging on remote host

What's the best method of logging a BASH shell session to a file on the host machine? The preferred output format would be equivalent to PuTTY's "printable output" log setting, as viewed by the user ...
17
votes
3answers
2k views

Is it possible to SSH access a server with a misconfigured subnet?

We have a server where one of our engineers misconfigured the subnet and now we are locked out of this server and the only access that I know of would work is a serial console from IDC (it means ...
15
votes
6answers
22k views

When IP aliasing how does the OS determine which IP address will be used as source for outbound TCP/IP connections?

I have a server running Ubuntu Server with four IP addresses aliased on a single NIC. eth0 192.168.1.100 eth0:0 192.168.1.101 eth0:1 192.168.1.102 eth0:2 192.168.1.103 (Using ...
13
votes
9answers
6k views

SSH server zero-day exploit - Suggestions to protect ourselves

According to the Internet Storm Center, there seems to be a SSH zero-day exploit out there. There is some proof of concept code in here and some reference: http://secer.org/hacktools/0day-openssh-...
10
votes
3answers
4k views

Logging a “persons” activity in Linux

So I've read many of the posts related to this and have just come up more confused than before. There are recommendations for various tools including ttyrec, snoopy, acct, rootsh, sudosh, ttyrpld, ...
14
votes
3answers
13k views

Connect through SSH and type in password automatically, without using a public key

A server allows SSH connections, but not using public key authentication. It's not within my power to change this at the moment (due to technical difficulties, not organizational) but I will get on it ...
11
votes
4answers
7k views

`sudo echo “bla” >> /etc/sysctl.conf` permission denied

Disclaimer: I'm pretty novice at sysadmin stuff. I'm trying to set up port forwarding in an AWS EC2 instance, this has to be done in the command-line because I don't want to go in and edit anything, ...
8
votes
4answers
738 views

Remote Root Login

I know one of the first things you do to secure a server is disallowing remote root login. Passwords are pretty weak; what do people think of only allowing root login via ssh keys or other password-...
22
votes
11answers
31k views

What can cause slow ssh session? [closed]

I ssh on remote host but terminal performance is poor. Symbols I am typing are not shown immediately, but with some delay. Sometimes two symbols are shown at one time after delay.
10
votes
3answers
5k views

Copy data through SSH tunnel over multiple hops

We have two main environments in question: Development and QA Each environment has two servers: Jump Box Application server In order to connect to the application server, you must connect to the ...
10
votes
4answers
17k views

SSH remote port forwarding failed

Follow-Up: It looks like the rapid series of disconnects coinciding with a few months of running each server is probably coincidental and just served to reveal the actual problem. The reason it failed ...
9
votes
4answers
2k views

Reverse SSH tunnel: how can I send my port number to the server?

I have two machines, Client and Server. Client (who is behind a corporate firewall) opens a reverse SSH tunnel to Server, which has a publicly-accessible IP address, using this command: ssh -nNT -...
5
votes
2answers
2k views

Improving speed of large file transfer over high latency link

So, I've recently had the need to pull a large file over the internet from one of our offices overseas. Both offices have 50Mbit fibre links in both directions, but the round-trip-time is horrendous ...
5
votes
3answers
8k views

Escaping spaces in a remote path when using rsync over a remote SSH connection

When using SSH to connect rsync to a remote server, how do you escape spaces and such in the remote path? A simple backslash escapes the space for the local bash prompt, but on the remote machine the ...
3
votes
3answers
14k views

how to restrict ssh login to a specific ip or host

i want to restrict my ssh login only for one ip address so i modified the following file $ nano /etc/ssh/sshd_config and added this line (i.e. my ip ) hoping that it will work ListenAddress ...
16
votes
3answers
15k views

OpenSSH: Difference between internal-sftp and sftp-server

Why are there two ways to setup SFTP with OpenSSH and when to use which? Is there any difference between them? I mean the first one is using a lib from OpenSSH and the second one says "use the ...
10
votes
4answers
11k views

Why does the $PATH of an ssh remote command differ from that of an interactive shell?

I have a user that has made no modifications to the $PATH in any dot-files: it is exactly the system default setting. From a login shell: $ ssh example.com user@example.com:~$ cat /tmp/hello.hs #!/...
9
votes
1answer
6k views

SSH client name resolution fails for names that are resolvable

We have a linux box (called jumper) that is used to access servers in a few separate DMZs. Each DMZ has its own subdomain name (e.g. idmz.example.org, jdmz.example.org), and each subdomain has its own ...
7
votes
1answer
3k views

Disable ssh password authentication by user

Is it possible to enable ssh password authentication for one user on a system and disable it for an other. If you add ChallengeResponseAuthentication no PasswordAuthentication no UsePAM no to /etc/...
7
votes
3answers
5k views

Running 'sudo' over SSH

I'm writing a script which is to log onto a bunch of remote machines and run a command on them. I've set up keys so the user running the script does not have to type the password of each machine, but ...
5
votes
2answers
3k views

Restrict SSH login from a specific user to a specific IP address

I'd like to restrict SSH logins for a specific FreeBSD user account to a specific IP address (they're automated rsync backups from one machine to another, no actual user should ever be logging in, ...
5
votes
2answers
7k views

ssh fails to execute remote command when run from cron bash script - works from CLI

I have a script, written in bash, which runs from cron. One of the first things it does is SSH to a remote host and retrieve a list of files in a directory. Everything works fine when run from the ...
5
votes
1answer
799 views

Accessing SSH_AUTH_SOCK from another non-root user

The Scenario: I am running ssh-agent on my local PC, and all my servers/clients are setup to forward SSH agent auth. I can hop between all my machines using the ssh-agent on my local PC. That works. ...