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)

0
votes
3answers
842 views

How do I block an email sender using SSH

Having a bit of a nightmare with our Linux server. Somehack is using our server for spaming. I sanitaized all inputs, have captcha image, change passwords, etc. but still. Somehow they keep on doing ...
0
votes
1answer
349 views

EC2 Instance Store to EBS Can't connect to SSH

I followed every line on this tutorial: http://webkist.wordpress.com/2010/03/16/creating-an-amazon-ec2-ebs-ami-from-a-running-instance/ to create a EBS instance using a AMI based on a Instance Store ...
0
votes
0answers
675 views

changing ssh port. Useful?

i will buy a dedicated server soon. I would like to know if changing the default port of ssh may be useful for security or it's completly useless. And if it's useful which ports range should I change ...
0
votes
2answers
1k views

SSH and port forward socks proxy

I would like to setup an ssh tunnel that includes 3 machines. One machine I want to make http requests from but can only connect to a central server and outbound port 80 requests. The server is a ...
-1
votes
2answers
275 views

how to ssh to the machine behind the firewall? [duplicate]

Possible Duplicate: SSH to a computer that will then SSH to another computer I have 3 Linux machines A, B and C. I can ssh from A to B; B to C but not from A to C directly because C is ...
33
votes
4answers
46k views

How to change sshd port on Mac OS X?

I want to change which port sshd uses on a Mac server. For example, let's say from port 22 to port 32. Editing /etc/sshd_config does not seem to work. Does anyone know how to change it? I'd prefer ...
62
votes
2answers
53k 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. ...
97
votes
1answer
28k 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?
37
votes
9answers
10k views

Why is SSH password authentication a security risk?

Most guides for OpenSSH configuration advise to disable password authentication in favor of key-based authentication. But in my opinion password authentication has a significant advantage: an ability ...
27
votes
8answers
85k 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! @ ...
34
votes
8answers
11k views

How can I run arbitrarily complex command using sudo over ssh?

I have a system that I can only log in to under my username (myuser), but I need to run commands as other user (scriptuser). So far, I have come up with the following to run the commands I need: ssh ...
28
votes
8answers
17k 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?
36
votes
4answers
25k views

How can I launch a screen session with a command over ssh on a remote server from my desktop?

I want to be able to launch screen sessions on remote servers from a single ssh command on my desktop. However, screen seems to need a terminal, which is not available when running a command through ...
16
votes
6answers
54k views

How can I edit the welcome message when ssh start?

I have a vps for my website hosting. It is running a ubuntu server. Every time I logged in my server by ssh, it displays a lengthy welcome message in my terminal. Linux node61.buyvm.net ...
21
votes
4answers
5k views

How do I sudo over sshfs?

On my local host alpha I have a directory foo that is mapped via sshfs to host bravo as follows: $ sshfs charlie@bravo:/home/charlie ~/foo However, on host bravo there is another user, delta, that ...
46
votes
5answers
37k views

“POSSIBLE BREAK-IN ATTEMPT!” in /var/log/secure — what does this mean?

I've got a CentOS 5.x box running on a VPS platform. My VPS host misinterpreted a support inquiry I had about connectivity and effectively flushed some iptables rules. This resulted in ssh listening ...
44
votes
1answer
20k views

ssh hostname returns “Bad owner or permissions on ~/.ssh/config”

When I try to ssh to another box, I get this strange error $ ssh hostname Bad owner or permissions on ~/.ssh/config But I made sure that I own and have rw permissions on the file: ls -la ~/.ssh/ ...
34
votes
4answers
11k views

How do I make ssh fail rather than prompt for a password if the public-key authentication fails?

I've got a script that ssh'es several servers using public key authentication. One of the servers has stopped letting the script log in due to a configuration issue, which means that the script gets ...
41
votes
1answer
27k views

SSH use only my password, Ignore my ssh key, don't prompt me for a passphrase

This is a question regarding the OpenSSH client on Linux, MacOSX and FreeBSD. Normally, I log into systems using my SSH key. Occasionally, I want my SSH client to ignore my SSH key and use a ...
25
votes
8answers
23k views

change directory automatically on ssh login

I'm trying to get ssh to automatically change to a particular directory when I log in. I tried to get that behaviour working using the following directives in ~/.ssh/config: Host example.net ...
19
votes
2answers
21k views

public key authentication fails ONLY when sshd is daemon

I have no clue on how this happens. The distro is Scientific Linux 6.1 and everything is set up to perform authentication via public key. Yet, when sshd is running as a daemon (service sshd start), it ...
17
votes
3answers
38k views

how do you create an ssh key for another user?

I'm trying to create an ssh key for another user. I'm logged in as root. Can I just edit the files generated by ssh-keygen and change root to the user I want?
10
votes
2answers
10k views

How do I set default permissions for SFTP for an Ubuntu Server?

We have an Ubuntu 10.04 server. How can I set it so that new files created (or copied) over SFTP or SSH have g+rw and g+rwx permissions (where appropriate)? I'm also using setgid (chmod g+s) so that ...
8
votes
3answers
10k views

How can I use the same key for SSH and SSL (https)

I'm trying to install the development tools for a small team, and I can't get the authentication right. Since we are a distributed team, the server is on the internet. And I'd like to have SSO+zero ...
29
votes
7answers
5k views

SSH: Two Factor Authentication

I currently have a Ubuntu Server 12.04 running OpenSSH along with Samba and a few other services. At the current time I have public key authentication set up, and I'm wondering if it's possible to set ...
20
votes
6answers
13k views

How can I set proxy for subversion with ssh tunnel?

I want to check out/update the code via proxy since my local connection is slow. I setup ssh tunnel : ssh -D 8090 user@ssh.proxy.net to forward all the packets to my localhost:8090. How can I set up ...
15
votes
5answers
9k views

SSH: Do you use one private/public key pair for each remote machine? Or a single pair for all?

When you want to have public key based ssh logins for multiple machines, do you use one private key, and put the same public key on all of the machines? Or do you have one private/public key pair for ...
10
votes
10answers
17k views

DNS Name lookup (was SSH) Not Working After Snow Leopard Upgrade

I think this started with the Snow Leopard update. Cleaned out the .ssh directory, still having the issue. ~: uname -a Darwin california-example-com.local 10.0.0 Darwin Kernel Version 10.0.0: Fri ...
9
votes
4answers
2k views

SCP filename tab completion

I use SCP regularly to move files between servers and I've heard rumoured that you can use tab-completion on the remote server if you're using public keys, but so far I have had no luck. What I'm ...
12
votes
2answers
2k views

Why does my OpenSSH key fingerprint not match the AWS EC2 console keypair fingerprint?

When I import my OpenSSH public key into AWS EC2's keyring the fingerprint that AWS shows doesn't match what I see from: ssh-keygen -l -f my_key It is a different length and has different bytes. ...
11
votes
3answers
5k views

Set up sftp to use password but ssh not to use password

Is it possible to set up a user on ubuntu with openssh so that ssh does not use password authentication but sftp does? I assume that if I change /etc/ssh/ssh_config to have PasswordAuthentication yes ...
9
votes
2answers
5k views

How can I close SSH tunnel gracefully?

I have open tunnel with ssh -2 -N -L 5001:localhost:1019 eonil@test.local The tunnel is working good, but I have to Ctrl+C or Ctrl+D to force quit the tunnel. How can I close the tunnel gracefully? ...
9
votes
4answers
5k views

When would ssh -t not be appropriate instead of ssh?

Using ssh -t instead of ssh for connections to remote servers has several advantages. For example, I can directly edit a file with vim: ssh -t host vim foo.txt, which would fail otherwise. Are there ...
5
votes
2answers
2k views

Easy multi-level authentication for sudo

I have a FreeBSD server with password-based SSH enabled. I would like to enable sudo, but I do not want a potential attacker to be one password away from root access. My current solution is logging ...
3
votes
11answers
856 views

Ubuntu Server SSH

I have a server with ubuntu. I do work on it over SSH. I had a problem with brute force attempts over port 22. I changed the port and I assumed it fixed the brute force problem. Am I right or are the ...
19
votes
7answers
4k views

Restart SSH on a machine where SSH is the only mode of access

I've made some changes to sshd_config file and therefore need to restart. I'm looking tips on safely restarting ssh when getting physical access to the server would be a huga PITA.
16
votes
4answers
5k views

Is it possible to get OpenSSH to log the public key that was used in authentication?

I have a production system where several different people are allowed to log in to a single account - the account is for the application and not for the person as we don't have personal accounts on ...
13
votes
13answers
29k views

Stop ssh login from printing motd from the client?

I've got SSH passwordless set up, however it prints the MoTD when it logs in. Is there anyway to stop that happening from the client side? I've tried ssh -q but that doesn't work. I don't want to use ...
12
votes
3answers
1k views

Inline SSH command

Is it possible to do a simple inline style SSH command, for example: ssh foo@bar.com { cd foo/bar && rm *.foobar }
11
votes
4answers
46k views

Free public SSH server for testing purposes [closed]

I'm writing an application that makes connections to SSH servers. It doesn't need anything specific from the server (except running under GNU/Linux). I need SSH servers for running my application ...
8
votes
4answers
6k views

Transfer files via SSH

I want to use file transfer via SSH on some scripts. I've read it's possible to tar over ssh. Where should I start reading?
8
votes
5answers
5k views

Can I create SSH to tunnel HTTP through server like it was proxy?

Say I have a server and client. I need to create connection from client to a website through server like it was proxy. Is it possible to do this using a SSH tunel, or do I have to install some proxy ...
6
votes
1answer
872 views

Adding port forwardings programmatically on a ControlMaster SSH session

I just found out about the ControlMaster/ControlPath feature of OpenSSH, which allows you to use a single SSH connection to run multiple terminals. As I often use SSH to use port forwarding to get ...
4
votes
3answers
7k views

How can I enable X11 forwarding to a Debian server box?

I want to connect to a server with SSH (a Debian installation in a VMware image). On that server I want to call gitk a repository viewer for git. What do I need to do to make this work?
1
vote
2answers
2k views

ssh remote command-fu

I am trying to do a remote backup from behind a firewall. It is really no problem to break this out into its own script that gets called in crontab, but that isn't any fun! What I am trying to do ...
12
votes
11answers
9k views

Best way to go about changing a root password on 3000+ Solaris, AIX, and Linux servers?

Long story short: Big old corporation, lots of UNIX/Linux servers. I inherited responsibility for a bunch of scripts that that left a few years ago. One of them was a script that would be run every ...
10
votes
2answers
14k views

How to check if a RSA public / private key pair matched

I have two files, id_rsa and id_rsa.pub, what command can be used to validate if they are the valid pair.
10
votes
6answers
31k 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
2answers
4k views

Authentication Order with SSH

i am still have troubles mastering sshd - when I login with -v I see that ssh is authenticating the following way debug1: Authentications that can continue: ...
8
votes
2answers
10k views

SFTP fatal bad ownership or modes for chroot directory ubuntu 12.04

I just set up my SFTP server and it works fine when I use it from my first user account. I wanted to add a user which we will call 'magnarp'. At first I did like this in sshd_config: Subsystem sftp ...