Shutting down a client machine from server using scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shutting down a client machine from server using scripts
# 1  
Old 03-31-2011
Shutting down a client machine from server using scripts

Hi,
i have several client machines connected to a server..how do i shutdown a specific client from server using shell scripts?? is it possible to use socket programming to establish a connection before doing this? (need a code in 'c')

thanking you
tanvi
# 2  
Old 03-31-2011
Shell command would be:
Code:
echo "shutdown -h now" | ssh root@clientMachine

This will ask you for password. If you don't want to have to input passwd manually, you need to generate keys for passwordless ssh.

You can invoke this from C, by calling
Code:
system('echo "shutdown -h now" | ssh root@clientMachine');

This User Gave Thanks to mirni For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Unable to connect to Server machine from a client machine using ftp service

Hi, Could you please help me with the below issue.. I'm running RHEL6 OS on both server (192.168.0.10) and client machines (192.168.0.1). I'm trying to connect to server from the client machine using ftp service. I have installed vsftpd daemon on both the machines. I'm getting... (4 Replies)
Discussion started by: raosr020
4 Replies

2. Solaris

machine server and machine client

Hello, i need to create a communication between two machines solaris 2 installed in VM workstation; to begin with NFS and do these : Machine A : share -F nfs /opt and in Machine B : mount -F nfs machineA:/opt /mnt also share -F nfs -o rw=machineB /opt and in B mount -F nfs... (0 Replies)
Discussion started by: herbich1985
0 Replies

3. Programming

Client/Server Socket Application - Preventing Client from quitting on server crash

Problem - Linux Client/Server Socket Application: Preventing Client from quitting on server crash Hi, I am writing a Linux socket Server and Client using TCP protocol on Ubuntu 9.04 x64. I am having problem trying to implement a scenario where the client should keep running even when the... (2 Replies)
Discussion started by: varun.nagpaal
2 Replies

4. UNIX for Dummies Questions & Answers

Link type between working machine and server machine

There are two servers where my machine is connected. Is there any type of link formed between my machine and server machine? (1 Reply)
Discussion started by: palash2k
1 Replies

5. Shell Programming and Scripting

How to shutdown client machine from the server

I have a unix server through which some ten client machines are connected. I want to shutdown/restart all the machine from the server through the shell script during the particular time of the day. I welcome your suggestions. Thanks in advance. With regards Victor (1 Reply)
Discussion started by: mvictorvijayan
1 Replies

6. UNIX for Dummies Questions & Answers

Shutting down the Server

Hi Is there anyway i can find out from which terminal a shutdown command has been run from ? :( (3 Replies)
Discussion started by: ktech
3 Replies

7. IP Networking

Explor the Unix server on Windows Client machine

Hi, I am doin a project that'll work as a normal Explorer on Windows but the best thing is it'll be exploring the content of a UNIX server. The application would be runnin on the windows platform with probably a FTP server on UNIX server. How i should proceed? (2 Replies)
Discussion started by: ziaullahk
2 Replies

8. Programming

program to transfer a file from client machine to server

1. we have a client & server ,and TFTP is running on the server. 2.we have 3 files a.exe,b.exe,c.exe in the client machine....we need to transfer all the 3 files to the server and store it into a DIR... 3.then we need to check in the server whetehr all the three files are sucessfully... (3 Replies)
Discussion started by: nathgopi214
3 Replies

9. Solaris

shutting down/restarting oracle with the solaris server restart

How can I make sure that all the database instances are shut down and brought up when the server is restarted. Krishan (3 Replies)
Discussion started by: krishan
3 Replies

10. Solaris

shutting down oracle with the server

What can I do to ensure that oracle database is shut down when the server reboots. (1 Reply)
Discussion started by: krishan
1 Replies
Login or Register to Ask a Question