2

Suppose, the server address is abcd.com. On my local machine at my workplace, I have to login to that server, using

ssh <my employeeid>@abcd.com

Then, to login to user myname , I have to use

su - myname

This way I login, but why can't I directly login to that server using

ssh myname@abcd.com
  • Check /var/log/auth.log. The user is probably not allowed to use SSH. Other ways to find more information is to make ssh more verbose with one or more -v flags or to run the daemon with a -d (debug) flag. – jippie Apr 15 '12 at 12:42
2

If you can't, this means that SSH daemon configuration (on the server) forbids it. This can be done by several different settings in /etc/ssh/sshd_config: AllowUsers, AllowGroups, DenyGroups and DenyUsers. Have a look at man sshd_config.

The order of interpreting those directives is also described in the manpage:

By default, login is allowed for all groups. The allow/deny directives are processed in the following order: DenyUsers, AllowUsers, DenyGroups, and finally AllowGroups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.