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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
07-24-2012, 03:21 AM
|
#16
|
Member
Registered: Feb 2011
Posts: 120
Original Poster
Rep:
|
Quote:
Originally Posted by xtpeqii
COULD YOU provide us the following content:
content in /etc/ssh/sshd_config
THOUGH YOU'D BETTER ASK SOMEONE WHO USE FEDORA in case of some difference between multiple distros.
|
Here is the information you are asking for in /etc/ssh/sshd_config
Code:
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
UseDNS no
|
|
|
07-24-2012, 04:00 AM
|
#17
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797
|
Is the ssh daemon running?
try the command in bold blue; you should see something like the first line
Code:
wim@webserver:~$ ps -ef |grep sshd
root 3033 1 0 2011 ? 00:00:00 /usr/sbin/sshd
root 6987 3033 0 10:49 ? 00:00:00 sshd: wim [priv]
wim 6989 6987 0 10:49 ? 00:00:00 sshd: wim@pts/0
wim 7004 6990 0 10:50 pts/0 00:00:00 grep sshd
wim@webserver:~$
Or the command posted by chrism01 in post #11 (run as root); again you should see something like the first line that indicates that something (ssh daemon) is listening on port 22
Code:
root@webserver:~# netstat -tanp |grep ssh
tcp6 0 0 :::22 :::* LISTEN 3033/sshd
tcp6 0 52 ::ffff:172.31.208.76:22 ::ffff:172.31.208:59466 ESTABLISHED6987/sshd: wim [pri
root@webserver:~#
|
|
|
07-25-2012, 07:03 AM
|
#18
|
Member
Registered: Feb 2011
Posts: 120
Original Poster
Rep:
|
Yaa bro.
It is running
I have checked it
|
|
|
07-25-2012, 07:49 AM
|
#19
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,797
|
I overlooked this in your earlier post #12
Code:
Read from socket failed: Connection reset by peer
Try to login as a normal user instead of root. I see that you did allow it in the config but maybe there is something else that blocks it (maybe you did not restart the ssh server after the change?). And in my opinion a security risk.
Once that works, you can use su or sudo to gain root access once your in the system.
Last edited by Wim Sturkenboom; 07-25-2012 at 08:29 AM.
|
|
|
07-25-2012, 08:04 PM
|
#20
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,441
|
Code:
PermitRootLogin yes
This is definitely a security risk and it is heavily recommended to NOT allow root over ssh.
You might also need to check /etc/hosts.allow, /etc/hosts.deny.
The other thing that can be an issue is the firewall; you can use
Code:
iptables -nvL
# Or
cat /etc/sysconfig/iptables # RHEL/Fedora
to check
|
|
|
All times are GMT -5. The time now is 04:26 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|