简体   繁体   中英

php script to login to a server through SSH

I have a server which I can normally access only through ssh on terminal using the command ssh 124.134.4.173 -l root
How can i use php to achieve the same result?

exec("ssh 124.134.4.173 -l root"); or shell_exec("ssh 124.134.4.173 -l root"); will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM