set environment variable for non interactive ssh login
I am facing one problem regarding ssh login and setting environment variable
i have written $HOME/.ssh/environment file
and ls-l /usr/bin/restricted is empty
also i have set the PermitUserEnvironment yes in /etc/ssh/sshd_config file
and restarted sshd process
when i perform ssh <username>(at the rate of)host 'command'
for example ssh user(at the rate of)<ip> 'ls -lart'
it is executing the command but as the path is /usr/bin/restricted it must not get executed . but when i do
ssh user(at the rate of)<ip> 'echo $PATH' --- it shows the path as /usr/bin/restricted
i want to restrict certain command thru non interactive ss login plzz tell me what is the issue with this
and how this can be solved