login about faq

How does the forced command work if I open terminal connection?

asked Dec 20 '10 at 12:40

SSH%20KB's gravatar image

SSH KB ♦
509249246237


Explicitly allowing terminal sessions in the server configuration overrides a forced command if connecting client requests a terminal session.

When user executes a remote command such as "sshg3 user@server ls", a forced command can be run instead of the original command (e.g. "ls") if the forced command has been defined in one of the following places:

  1. <command> element in ssh-server-config.xml
  2. command option in authorization file (when logging in with the key that the option applies to)
  3. command option in OpenSSH style authorized_keys file (when logging in with the key that the option applies to)

However, when the client asks for a terminal session (e.g. "sshg3 user@server") the behavior depends on the configuration, and what services the user is allowed in the <services> block. If terminal is explicitly allowed ( <terminal action="allow" /> ), the user will get a terminal even though there is a forced command configured. If terminal is denied ( <terminal action="deny" /> ), or if there is no configuration regarding terminal ("implicit allow"), the forced command is run.

link

answered Dec 20 '10 at 12:40

SSH%20KB's gravatar image

SSH KB ♦
509249246237

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2

Asked: Dec 20 '10 at 12:40

Seen: 1,626 times

Last updated: Mar 14 '11 at 20:22

All user contributed content licensed under the cc-by-sa license.
Powered by OSQA.