LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-24-2012, 01:24 AM   #1
deathsquadd
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Rep: Reputation: Disabled
ssh redirect script question


Here's the dillema. I am in a Linux OS class and there is this dude who thinks he's the sh*t because he figured out the insanely easy command to remote restart computers using ssh.

Obviously I'm pretty new to this but is there a script I can write that can take that remote command to restart and reflect it back to him and so essentially he restarts his own computer?

I want to make it so I can enable and disable the script.

Any help with this would be greatly appreciated.
 
Old 02-24-2012, 01:28 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
From the LQ Rules: "Posts containing information about cracking, piracy, warez, fraud or any topic that could be damaging to either LinuxQuestions.org or any third party will be immediately removed".
 
Old 02-24-2012, 01:32 AM   #3
deathsquadd
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
So the question I just posted is requesting illegal info? I guess I'm confused.
 
Old 02-24-2012, 01:40 AM   #4
deathsquadd
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by catkin View Post
From the LQ Rules: "Posts containing information about cracking, piracy, warez, fraud or any topic that could be damaging to either LinuxQuestions.org or any third party will be immediately removed".
Let me clarify. There is no hacking, cracking blah blah blah involved with this request. This is all happening in a closed environment with no access to the outside world, only a closed network in a classroom. This person is essentially annoying everyone by his incessant desire to restart peoples computers. I'm not going to be that guy who tattles to the instructor. I don't know how asking about a script to protect my computer and learning experience by preventing someone from interrupting said experience falls into violation of the rules above.
 
Old 02-24-2012, 05:55 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
1. in a class, if he is doing this and it's against class rules (as it seems ?), then he's being disruptive and should be reported
2. he can only ssh in if he knows your login name & passwd; change them (or at least the passwd).

PS option 3:
gather all affected users and go and have a WORD with him ...

Last edited by chrism01; 02-24-2012 at 06:25 AM.
 
1 members found this post helpful.
Old 02-25-2012, 08:30 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
As chrism01 said. A counterattack is counterproductive: he breaks the rules, you do as well. Both of you will be punished. Report the bad or simply annoying behaviour to your teacher and the trick is done!
 
1 members found this post helpful.
Old 02-25-2012, 11:28 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,921

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by deathsquadd View Post
Let me clarify. There is no hacking, cracking blah blah blah involved with this request. This is all happening in a closed environment with no access to the outside world, only a closed network in a classroom. This person is essentially annoying everyone by his incessant desire to restart peoples computers. I'm not going to be that guy who tattles to the instructor. I don't know how asking about a script to protect my computer and learning experience by preventing someone from interrupting said experience falls into violation of the rules above.
That's fine, but try to look at it from our standpoint. The only way we know this is by you TELLING us...we have no way of knowing it's true, or what you'll actually use it for. You're asking for a script that can do things remotely to another computer; that's the only fact we can ascertain, and that's what makes it against the LQ rules.

You may not WANT to be that guy who tattles, but that's the way life is. Do you think such behavior would be tolerated in the real working world? If this guy is annoying the whole class, he's costing everyone time and effort and should be reported, period. Your other option is to walk over to his desk next time it happens, and very loudly ask him what the hell his problem is.

Changing your user id/password is the best step, as would be looking into the AllowUsers/DenyUsers directives in the sshd_config file. Rebooting your machine needs root access...change the PermitRootLogin line to be NO, change your root password, and make sure that only YOUR user ID is allowed to SSH in. Those are some good learning steps, since you'll then have one of the basic system hardening steps done.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Script question: Shell script in kde to log in on a server with ssh c4719929 Programming 18 01-31-2011 10:26 AM
[SOLVED] Script question: create a shell script in kde to log in on a server with ssh c4719929 Linux - Newbie 1 01-31-2011 04:05 AM
ssh shell script question ihickman Linux - Newbie 4 02-02-2009 02:10 PM
ssh and script does not redirect stderr in bakground ahk_bly Linux - Newbie 0 11-18-2008 08:02 AM
ssh and bash script question babag Linux - Networking 4 06-28-2008 01:26 AM


All times are GMT -5. The time now is 08:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration