You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by binaryatwork <bi...@yahoo.com> on 2014/06/20 03:29:36 UTC

How to remove SSH commands?

My project use Karaf(v.3.0.1) container and console.  The platform is rhel6. 
We have karaf running as a service and end-users can connect to it with
client session.  For getting client sessions, the project must have
sshd-core-0.9.0.jar and org.apache.karaf.shell.ssh-3.0.1.jar in the
startup.properties file.  

I need to remove a lot of default commands(e.g. shell:exec) since end-user
access to the system is restricted.  I want to remove ssh:ssh and ssh:sshd
commands but the commands(SshAction and SshServerAction) are packaged with
other ssh classes that are required for client session.  

SshAction and SshServerAction are registered by Blueprint container that I
can't get hold of their ServiceRegistration.  I can remove the commands from
the shell-ssh.xml file, recompile and build the package but I would rather
find a way to  unregister them.

Anyone know how to unregister default commands in karaf programmatically?

Thank you very much



--
View this message in context: http://karaf.922171.n3.nabble.com/How-to-remove-SSH-commands-tp4033649.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: How to remove SSH commands?

Posted by binaryatwork <bi...@yahoo.com>.
Thank you for the reply.

1/ ACL is not used in the project and I don't want to use ACL just for this
reason.
2/ This is my queston -  How to unregister default command services in karaf
programmatically if you are not the one who register them(i.e. you don't
have the ServiceRegistrations of the command services)?   .....kind of make
sense that if I did not register them, i should not unregister them.

Yes, I can uninstall org.apache.karaf.shell.ssh bundle but karaf client
session will not be created without org.apache.karaf.shell.ssh service
installed - i.e. problem because the service function and service commands
are packaged together in a bundle, can't uninstall partial bundle.



--
View this message in context: http://karaf.922171.n3.nabble.com/How-to-remove-SSH-commands-tp4033649p4033664.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: How to remove SSH commands?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

You have two ways:

1/ using the ACL
2/ actually remove the command services (all commands are exposed as 
services)

For ssh, you can also uninstall the org.apache.karaf.shell.ssh bundle.

Regards
JB

On 06/20/2014 03:29 AM, binaryatwork wrote:
> My project use Karaf(v.3.0.1) container and console.  The platform is rhel6.
> We have karaf running as a service and end-users can connect to it with
> client session.  For getting client sessions, the project must have
> sshd-core-0.9.0.jar and org.apache.karaf.shell.ssh-3.0.1.jar in the
> startup.properties file.
>
> I need to remove a lot of default commands(e.g. shell:exec) since end-user
> access to the system is restricted.  I want to remove ssh:ssh and ssh:sshd
> commands but the commands(SshAction and SshServerAction) are packaged with
> other ssh classes that are required for client session.
>
> SshAction and SshServerAction are registered by Blueprint container that I
> can't get hold of their ServiceRegistration.  I can remove the commands from
> the shell-ssh.xml file, recompile and build the package but I would rather
> find a way to  unregister them.
>
> Anyone know how to unregister default commands in karaf programmatically?
>
> Thank you very much
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/How-to-remove-SSH-commands-tp4033649.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com