0

I need to restrict access to 1 of my linux servers . so i added to my "authorized_keys" file before the key :

no-pty ssh-rsa ..............

I disabled the password access to this machine from couple of ip's

In the seconds server that running ansible i need to success "Deploying" to the restricted server .

i need to know how i can permit couple of commands :

rsync scp Also i would like to disable the option to run commands to the restricted server like that :

ssh ***.***.***.*** | bash "date"

So once i'll run the ansible playbook i will be able to rsync / scp files to the restricted server

how can i do that ?

Thanks a lot ! Amit

Amit Daniel
  • 297
  • 1
  • 5
  • 16
  • `ssh .... | bash "date"` will not run any commands on the remote host. That will run `ssh` with no commands and then feed the output of the `ssh` session to the standard input of `bash "date"` (which is an error as `bash` will not find a `date` file). So that's not the command you meant there. – Etan Reisner Jul 29 '15 at 13:51
  • i just gave an example . i can connect to the remote host ( restricted host ) if i'll run "ssh ***.***.***.*** bash " or every command like that i would like to disable this too . – Amit Daniel Jul 29 '15 at 14:00
  • Duplicate of http://stackoverflow.com/questions/402615/how-to-restrict-ssh-users-to-a-predefined-set-of-commands-after-login – larsks Jul 29 '15 at 14:15
  • @larks it's not a duplicated topic CAUSE will not work in this setup , thanks ! – Amit Daniel Jul 29 '15 at 14:19
  • Cause rsync command will not work * – Amit Daniel Jul 29 '15 at 14:29

0 Answers0