LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 11-25-2008, 08:02 AM   #1
CPurnima
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Rep: Reputation: 0
How to prevent others from remotely logging into my pc through ssh command?


Plz tell me a solution to restrict others(in my network) from logging into my pc using the command: ssh my-ip-address
 
Old 11-25-2008, 08:05 AM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
They need to type in your password to successfully log in. If they know the password, change it (or add their IPs to your /etc/hosts.deny
 
Old 11-25-2008, 10:26 AM   #3
teknik
Member
 
Registered: Jun 2006
Location: Winnipeg, Canada
Distribution: Slackware 12.1
Posts: 33

Rep: Reputation: 16
or just kill the ssh server..
 
Old 11-25-2008, 11:56 AM   #4
nehaandrew
Member
 
Registered: Nov 2008
Posts: 53

Rep: Reputation: 15
Unless you have given out our password to anyone - you don't have to worry about them logging into your server via SSH using your credentials.

If you don't want anyone to log into your server via SSH - you can ask your server admin to disable the SSH service completely per se.

Linux

Last edited by nehaandrew; 11-30-2008 at 01:13 AM.
 
Old 11-25-2008, 08:41 PM   #5
salter
Member
 
Registered: Oct 2008
Posts: 100

Rep: Reputation: 15
Put SSH on some port other than the default, to minimize brute force attacks.

You can also create or get some crontab script that parses the /var/log/secure* files for repeated break-in attempts and adding those IP's to your /etc/hosts.deny file.

Or get yourself a Router device and use NAT port forwarding to hide your SSH port by means of redirection.

Must be a tough neighbourhood if you are attacked by users from your own network. Maybe even change your password every few days.

Last edited by Tinkster; 10-30-2010 at 05:11 PM.
 
Old 11-26-2008, 12:13 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You should also use the option in the sshd config to disable (remote) root login anyway.
 
Old 11-26-2008, 08:03 AM   #7
CPurnima
LQ Newbie
 
Registered: Nov 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sycamorex View Post
They need to type in your password to successfully log in. If they know the password, change it (or add their IPs to your /etc/hosts.deny
Thank you,,,,
 
Old 11-26-2008, 08:10 AM   #8
python09
LQ Newbie
 
Registered: Nov 2008
Distribution: Ubuntu, Redhat
Posts: 10

Rep: Reputation: 0
You may use public key and private key to login your pc instead of using password , so other people can not login with brute force attack.
Also, you may install the software like fail2ban to block malicious user.
 
  


Reply



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
SSH Gateway (not just forwarding) with command logging - can it be done? cejennings_cr Linux - Security 2 02-09-2017 10:27 PM
ssh command logging jcookeman Linux - Security 3 08-26-2008 02:50 AM
from Win XP, remotely execute a command on Linux using ssh lothario Linux - Software 3 06-21-2008 05:59 PM
How to prevent root user from logging into ssh linuxjamil Linux - Server 2 10-08-2007 06:10 PM
Running a shell script remotely via 'ssh <hostname> <command>' davee Linux - General 4 10-09-2005 01:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:44 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
Open Source Consulting | Domain Registration