Hot answers tagged

144

From the manpage: PermitRootLogin Specifies whether root can log in using ssh(1). The argument must be “yes”, “without-password”, “forced-commands-only”, or "no”. The default is “yes”. If this option is set to “without-password”, password authentication is disabled for root. If this option is set to “forced-commands-only”, root ...


98

By default PasswordAuthentication is set to yes, even if you comment it out in /etc/ssh/sshd_config. You'll need to explicitly set PasswordAuthentication no to allow only Public Key Authentication. # To disable tunneled clear text passwords, change to no here! PasswordAuthentication no NOTE (man sshd_config): PasswordAuthentication specifies whether ...


53

Try purging before install: sudo apt-get purge openssh-server sudo apt-get install openssh-server


37

Simply restart the sshd service: sudo service sshd restart or: sudo /etc/init.d/sshd restart


37

Put DenyUsers user1 user2 user3 in /etc/ssh/sshd_config


19

The command systemctl disable ssh did it for me. @Jakuje: Thanks for giving me the idea.


16

This is the process: Add the user to the group: sudo usermod -aG www blub as in Whats the simplest way to edit and add files to "/var/www"? or just use sudo adduser <username> www-data Install vsftpd sudo apt-get install vsftpd Configure vsftpd for remote access: sudo nano /etc/vsftpd.conf and inside the file set chroot_local_user=YES and ...


16

This was solved for me by following the instructions on http://peter-butkovic.blogspot.com/2013/08/tail-inotify-resources-exhausted.html Permanent solution (preserved across restarts) Adding line: fs.inotify.max_user_watches=1048576 to: /etc/sysctl.conf fixed the limit value permanently (even between restarts). then do a sysctl -p


16

Actually this setting does pretty much nothing if you are using PAM authentication. At the bottom of the sshd_config configuration file you will find: # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # ...


16

Artyom answer is correct. I'd just like to point that there is also the possibility to opt for a 'white-list' approach instead of the 'black-list' one by putting a line like this in /etc/ssh/sshd_config: AllowUsers AuthorizedUser1 AuthorizedUser2 and reloading ssh service (service ssh restart) Then every other user will be denied ssh access (be careful ...


14

Try un-installing and then installing openssh-server: sudo apt-get remove openssh-client openssh-server and then sudo apt-get install openssh-client openssh-server This worked for me. If you still can not connect, try sudo ufw status verbose and let us know what the output is.


14

clear/remove /etc/legal that contains the message ... or ... create a file ~/.cache/motd.legal-displayed Read more: ubuntuforums.org/showthread.php?t=1511335


13

According to this wiki page about SSH keys and this answer, you need to change these two lines in your sshd_config: PasswordAuthentication no ChallengeResponseAuthentication no


12

According to man 5 sshd_config: %h is replaced by the home directory of the user being authenticated This means the file will be /home/user/.ssh/authorized_keys. If the .ssh directory is missing (which seems normal if not previously configured) you can create it and also the authorized_keys file within and then populate the file's contents with your ...


10

There are two ways to configure ssh to require both a public key and a password or passphrase. The difference between the password and the passphrase: The password in this context is the password assigned to the user in the server computer (the board). If the board has only one user account, then it will have only one password. If the board has multiple ...


9

I think that answer is not complete (it doesn't say anything about the maximum limit of files open on the system). There are two limits regarding the maximum number of open files: Maximum limit of files open per process. You can see which is the value of this limit using: ulimit -n You can change this limit using: ulimit -n new_limit_number Here is a ...


7

The problem usually arises if your home directory is encrypted. The usual solution is to put your keys in a directory other than your home directory, and point your sshd_config file to it. For example: Move your authorized_keys file on the server from /home/buck/.ssh/authorized_keys to something like /etc/ssh/keys/buck/authorized_keys set the permissions ...


7

This is documented in man systemctl: systemctl disable ssh prevents ssh service from automatic starting. But this is the way systemd does it, but ubuntu does not accept it and they have to do it their own way: Official documentation: https://wiki.ubuntu.com/SystemdForUpstartUsers#Automatic_starting According to this you should create unit override ...


6

note to the reader: for me (ubuntu 14.xx) only Bryan Agee's answer worked: /etc/init/ssh.conf: comment out the "start on filesystem or runlevel..." line why won't the others do? sudo mv /etc/init/ssh.conf /etc/init/ssh.conf.disabled will result in completly deactivating the service. It is then not startable through "service ssh start" anymore. ...


6

First make sure that ssh service running on 192.168.1.7 or not..it is possible that system doesn't have an SSH daemon, so you need to install ssh on that system. sudo apt-get install openssh-server If it's already installed, run sudo service ssh restart, then comment here with the output of this command from both the systems.


6

Ubuntu ssh service will start with ssh, not sshd. Try: sudo apt-get remove --purge openssh-server sudo apt-get install openssh-server Then try: sudo service ssh restart To check its status: sudo service ssh status Config file can be found at /etc/init/ssh.conf Detail about remove and purge: remove - Does NOT remove including configuration files ...


6

Most likely, you've run out of your inotify watches. Probably, you're running some file synchronization tools(eg. Dropbox) in background? In Linux, the internal implementation of tail -f command uses the inotify mechanism by default, so as to monitor file changes. If you've run out of all the inotify watches(8192 by default), then inotify -f have to ...


6

Anything in log files, particularly /var/log/auth.log? You might also double-check permissions on the .ssh directory and files. I haven't had to modify sshd_config for this kind of access, myself. I am wondering if your modification broke things, especially the AuthorizedKeysFile line. Typically, you would want to put the authorized_keys under $USER/....


6

Eric Carvalho's answer works for pre 15.04 but they deprecated and then removed upstart from Ubuntu, SystemdForUpstartUsers. These steps have been adapted to work with systemd. Copy the SSH configuration file: sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config_external Copy the systemd configuration file: sudo cp /lib/systemd/system/ssh.service /lib/...


5

For system having systemd the proper way to do it is sudo systemctl disable ssh.service then sudo systemctl stop ssh.service


5

If I am not sure if a program reads a specific config file (or in which order), I try to trace the open syscalls with strace. To do this stop the ssh daemon. Then start it manually in the terminal by: strace -e open -ostrace.out /usr/sbin/sshd After it has started you should have a file in your current working directory called strace.out. In my case it ...


5

sudo service ssh restart will not do it. You need to restart sshd, not ssh: sudo service sshd restart


Only top voted, non community-wiki answers of a minimum length are eligible