run ssh connection from non-root user

Метки: ssh

1. user is non root, need to login using it.

[root@as02 log]# su asterisk
This account is currently not available.

fixing this:

[root@as02 log]# chsh -s /bin/sh asterisk
to revert:

[root@as02 log]# chsh -s /sbin/nologin asterisk

2. ssh-keygen with default values and empty password.
3. it copies 2 files in home dir currently /var/lib/asterisk/.ssh
4. use public file in destionation server.
5. chmod /priv file 600 and private file dir as 700
6. connect to server ssh root@name-or-ip "command".
7. it warning you about trust, say yes and it creates trust file in /homedir/.ssh so you will can connect without being prompted.
8. run scpirts using phone calls!

like this:

exten => 111,1,Answer()
exten => 111,4,Authenticate(555)
exten => 111,5,System(/bin/server-halt.sh)
exten => 111,6,Playback(activated)
exten => 111,7,Playback(goodbye)
exten => 111,8,Hangup()

#!/bin/sh
ssh root@name-or-ip "halt"

gl!

Tags for run ssh connection from non-root user
Вход в систему
Image CAPTCHA
Enter the characters shown in the image.