the secure shell (SSH) daemon

learn more… | top users | synonyms

16
votes
1answer
19k 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 ...
14
votes
2answers
1k views

SSH ignores characters after correct password string?

Remote machine 10.10.10.1 has password "asdFGH12" for user named "user". I'm able to log in even if I type in password "asdFGH12dasdkjlkjasdus" or any other characters after the "asdFGH12" string. $ ...
14
votes
2answers
339 views

What is the difference between these two SSHD configs?

1 Match Group GROUPNAME, User *,!root 2 Match Group GROUPNAME User !root My question: What is the difference between #1 and #2 in the SSHD_CONFIG?
12
votes
5answers
643 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 ...
8
votes
4answers
594 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 ...
6
votes
4answers
2k views

How to debug SSH port forwarding

This is an extension to ssh port forward to access my home machine from anywhere I tried things mentioned there but I am not able to ssh to my machine. Netgear router settings for port forwarding: ...
5
votes
2answers
6k views

What do the channel numbers in ssh error message refer to?

In the example below what do the channel numbers correspond to? Which are on the server? Which are on the client? $ ssh -L1570:127.0.0.1:8899 root@thehost Password: Last login: Fri Aug 9 ...
5
votes
5answers
557 views

How to setup password-less ssh with RSA keys

I am trying to setup a password-less SSH configuration between two machines and am having trouble. There are a ton of howtos out there that I have followed and have had no success. Here are ...
5
votes
4answers
864 views

ssh command unexpectedly continues on other system after ssh terminates

I'm running the below command, and monitoring the output file on the other system: ssh $ip_address 'for n in 1 2 3 4 5; do sleep 10; echo $n >>/tmp/count; done' If I kill the ssh command ...
5
votes
1answer
127 views

hosts.allow: %u not working (log username)

I need to keep track of all SSH connections on my server. In my /etc/hosts.allow I have something like this: sshd: ALL : spawn ( echo "`date` from %u %a " >> /var/log/ssh/%d.log ) & where ...
5
votes
1answer
61 views

Linux: $SSH_CONNECTION is set even without SSHing to the server

I have a remote server and I am writing a script in the server and want it to fire only when I SSH. I thought of using the $SSH_CONNECTION and $SSH_TTY for this purpose. I found out that when I have ...
5
votes
1answer
243 views

Logging ssh remote commands to `bash_history`

SSH allows a remote user to issue some command without interactively logging in to the server, as the last line of ssh usage indicates: usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c ...
5
votes
1answer
3k views

X client forwarded over SSH “cannot open display: localhost:11.0”

I have enabled X forwarding on remote machine where SSH server is running: # grep -i forward /etc/ssh/sshd_config X11Forwarding yes # On local machine, I have started SSH client with -X flag ...
4
votes
1answer
236 views

Executing a remote command on SSH connection, before login

I am trying to find a way to execute a specific command when connecting to a server via SSH. By this I mean, the command will execute unconditionally on opening a connection, so this would preferably ...
4
votes
1answer
46 views

Seperate messages of multiple sshds in syslog-ng

Is there a common way of distinguishing between the messages of multiple processes in syslog-ng beside setting different facilities? +1 if filtering and therefore logging in different files would be ...
4
votes
1answer
758 views

My reverse-ssh tunnel is using keepalives but they're not helping

I have an ssh client machine picard behind multiple unreliable internet connections - all with NAT. I have my server time, reliable with a static IP. I want to be able to access picard thorugh time. ...
4
votes
1answer
27 views

How to exclude from a “Match Group” in SSHD?

There is a Match group in the SSHD config: cat /etc/ssh/sshd_config ... Match Group FOOGROUP ForceCommand /bin/customshell ... There are many users on the machine that are in the ...
4
votes
2answers
459 views

How to Provide login delay in ssh

I wanted to provide login delay while login through ssh .I tried couple of ways of doing same but couldn't find desired result. I tried steps provided by given link. ...
3
votes
4answers
213 views

Internet SSH Server Security Considerations

What steps should I take to reasonably secure my linux desktop before opening sshd to the Internet so I can connect from anywhere?
3
votes
1answer
272 views

How can I restart the SSH daemon on Ubuntu?

When I type in service sshd restart I get a sshd: unrecognized service error. I do have, in /etc/ssh/ a file sshd_config that I use to set config. I can also putty into the Ubuntu box (it is remote). ...
3
votes
2answers
83 views

Why does SSH hosts keys differ when connecting if the host_keys are the same?

There are 3 machines: A (from where I connect to B and C), B, and C. B and C have the same SSHD host keys (they have been copied, so they are 100% the same, SSHD has been restarted too, identical ...
3
votes
1answer
1k views

Can sshd restrict client tunnel endpoints to localhost?

Normally an ssh client can request TCP forwarding using the -L command line option. The server can disable this completely using AllowTcpForwarding no. If enabled, the client can request to connect ...
3
votes
1answer
5k views

Fedora 18 - Start sshd on boot

I've just installed Fedora 18, and trying to configure sshd - I used chkconfig but this is only starting sshd when a user is logged in. How do I change so that sshd starts on system boot?
3
votes
2answers
495 views

Is there an easy way to not log a specific sshd event?

The monitoring tool of my hoster is making regular connections with ssh on port 22 to see or the service is up. This is cluttering my /var/log/messages with this kind of messages: Dec 13 22:20:17 ...
3
votes
1answer
43 views

SSHD Password Feedback (Show Asterisks for Characters)

Is it possible to have SSHD show asterisks for the password characters much like pwfeedback does for sudo? I am using CentOS 6.5. For example:
3
votes
1answer
493 views

Public-Key Authentication w/ Jailed SFTP User

I'm trying to set up a jailed SFTP user account on my own local machine to test an application with libcurl. I used this guide to help me figure out how to set up a jailed SFTP user: ...
3
votes
1answer
3k views

SSH publickey works for root but not user [duplicate]

Possible Duplicate: Why am I still getting a password prompt with ssh with public key authentication? I'm setting up a remote server. The sshd is configured to use publickey only. There ...
3
votes
3answers
416 views

How to install openssh in Crux Linux

In Crux Linux I already have installed SSH but when I use ssh-keygen, and try to use the command: ssh localhost to test SSH I get this error: # ssh localhost ssh: connect to host localhost port ...
3
votes
2answers
33 views

Starting SSH server after VPN starts

I am running an OpenVPN server on Ubuntu 14.04 as well as OpenSSH. I have my SSH server configured to bind to an IP address on my VPN interface. Once my machine boots, binding to that IP fails. ...
3
votes
0answers
39 views

Are there any canned solutions for running sshd in the initrd?

This is mostly aimed at Debian/Ubuntu, but I feel savvy enough on a variety of distros to be able to adapt the solution for one distro to another. Here's my scenario. There are a few situations when ...
3
votes
0answers
31 views

unable to forward X11 applications [duplicate]

I installed a headless Debian server which has Wireshark installed. Now I would like to run Wireshark in a way that it uses X11 server running in my Linux Mint laptop. As a first step I permitted X11 ...
2
votes
3answers
1k views

How to limit ssh access for localhost only?

I need to forbid ssh access (except localhost) for specified user. So. ssh localhost should work. ssh hostname from outside should not work for that user. All other users should work as usual.
2
votes
2answers
943 views

Why does sshd requires an absolute path?

Why does sshd require an absolute path when restarting, e.g /usr/sbin/sshd rather than sshd Are there any security implications? P.S the error message: # sshd sshd re-exec requires execution with ...
2
votes
2answers
7k views

sshd_config MaxSessions parameter

I have problem with "MaxSessions" parameter in sshd. I would like to restrict number of sessions via one ssh connection. For example for tcp forwarding. When I set MaxSessions to 0, logons are not ...
2
votes
1answer
96 views

SFTP chroot jail/access based on wildcard

I want to give a list of people SFTP access to /webdocs/ABC* where they will read-write access to only directories that match this wildcard. How do I do this? Can I create a chroot jaill or some ...
2
votes
1answer
103 views

How to upgrade SSHD without the change of the server key?

So... we need to upgrade the SSHD. How can we do this without having that issue that the people (who are signing in through ssh) would see the message: ...
2
votes
2answers
669 views

nmap isn't showing sshd?

I want to open a ssh terminal but it gives me a connection refused on port 22. My nmap doesn't list a port 22? How can I connect to my server? PORT STATE SERVICE 21/tcp open ftp ...
2
votes
1answer
247 views

Why doesn't my new cygwin .bashrc interactive check work?

I just updated Cygwin and the new .bashrc contains this line right at the top: echo "BEFORE TEST" # If not running interactively, don't do anything [[ "$-" != *i* ]] && return echo "AFTER ...
2
votes
1answer
33 views

Accept any private key for authentication

Is it possible to configure OpenSSH (or any other standard sshd) to accept any key offered by a connecting client? EG ssh -i ~/arbitraryKey hostname grants a login shell while ssh hostanme doesn't. ...
2
votes
1answer
61 views

Unable to connect after ChrootDirectory within sshd_config

After adding the following to my sshd_config file... Match user myuser ChrootDirectory /var/www/html X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp I am unable to ...
2
votes
1answer
107 views

Reconfigure login through root ftp (lost ssh access)

My question is twofold. I need to somehow re-enable telnet and/or ssh in a device where I currently only have root ftp access. Also, if I am going about this wrong, please let me know. Details to ...
2
votes
1answer
493 views

How can I tell if sshd is running with ClientAliveInterval > 0?

The title pretty much says it all, I'm a user on a system, and I want to know if that system is running sshd with a ClientAliveInterval > 0, which would tell me if I need to worry about using ...
2
votes
1answer
55 views

Is there a way to run a privileged command upon successful SSH login (not necessarily with shell or PTY)?

I'd like to run a privileged command upon successful SSH logins at the server's end. However, this has to be in the server configuration (sshd_config or anything else that cannot be manipulated or ...
2
votes
1answer
221 views

How to dump SSHD process and search for strings

Symantec has disclosed details on an SSHD backdoor and suggests to dump the SSHD process and search for some particular strings. NOTE: Background here: Symantec report on Linux Back Door I have no ...
2
votes
3answers
1k views

Use SSH key authentification with custom user $HOME

I have some users which have different $HOME directories than /home/... The user homes are under /pkg/homeand /pkg owner is a different user but all users have group access to /pkg. But it seems ...
2
votes
3answers
780 views

I killed sshd but it's still running?

On AIX 6100-05-01-1016 I accidentally killed the sshd. But for a suprise it still was running. Why? I did a: kill PID Q: ..so sshd doesn't reacts to normal kill signal? or are there any default ...
2
votes
1answer
614 views

How to resolve ssh connection refused on AIX?

I am no longer successfully able to connect to my AIX LPAR. ssh -v user@<ip> OpenSSH_6.2p2, OpenSSL 1.0.1c 10 May 2012 debug1: Reading configuration data /etc/ssh_config debug1: Connecting to ...
2
votes
1answer
33 views

How to prepare a headless machine?

I'm currently preparing an SD-card for my Raspberry Pi, i.e. an ARM machine, while I'm sitting on a x86 one. Therefore I cannot simply chroot into it and run rc-update add sshd default. So, how else ...
2
votes
1answer
215 views

How to terminate an interactive ssh session after certain amount of time

In my /etc/ssh/sshd_config file I have set the below parameters: ClientAliveInterval 10 ClientAliveCountMax 3 Now from host machine I did ssh to the my server (where I made changes to ...
2
votes
1answer
84 views

Assuming sshd allows only public key authentication, how do I log the fingerprints?

With OpenSSH, how can I log the fingerprints of the keys used for authentication? I would like to log it in production, so it would be best if this wasn't just some debug setting or similar.