cannot connect ssh as root

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Hello I realy dont have a lot of knowledge about servers/ftp etc so i’m sorry if i don’t sound undertandable juste tell me how to tell you more acurate info..
I have followed a tutorial to make my ftp use sftp here is the link :

Mettre en place un serveur SFTP sous Debian 8


the link is not in english but this is what i did :
apt install openssh-server

then i opened /etc/ssh/sshd_config
nano /etc/ssh/sshd_config

and i changed Port 22 to Port 666
also i added this at the end of the file :
Subsystem sftp internal-sftp
Match group sftp
ChrootDirectory /home/%u
X11Forwarding no
AllowTcpForwarding no

then i have written all these commands in the terminal :
addgroup sftp
mkdir -p /home/fred
useradd -s /bin/false -d /home/fred -g sftp fred
passwd fred
chown root:root /home/fred/
chmod -R 770 /home/fred/
usermod -d / fred

then the tutorial asked to activate the sftp this way :
systemctl restart ssh

But I got this error :
Job for ssh.service failed. See ‘systemctl status ssh.service’ and ‘journalctl -xn’ for details.

Then i got logged out so I tried to reconnect with theses ways but no one worked :
sftp [email protected]

got : ssh: connect to host IPofServer port 22: Connection refused
sftp [email protected]:666

got : ssh: connect to host IPofServer port 22: Connection refused
ssh [email protected]

got : ssh: connect to host IPofServer port 22: Connection refused
ssh [email protected]

got : ssh: connect to host IPofServer port 22: Connection refused
ssh [email protected] -p 666

ssh: connect to host IPofServer port 666: Resource temporarily unavailable
sftp -oPort=666 [email protected]

ssh: connect to host IPofServer port 666: Resource temporarily unavailable
Now I have changed the file using Webmin (I dont know why he can connect to the server but he did..)
i changed back 666 to 22 and removed the piece of code from the end of the file
but still :
ssh [email protected]

ssh: connect to host IPofServer port 22: Connection refused
If you need more info please tell me

X ITM Cloud News

Marisa

Leave a Reply

Next Post

This location could not be displayed. You do not have the permissions necessary to view the contents of "USB Flash Drive"

Fri Sep 11 , 2020
Spread the love          Using Ubuntu 20.04. I have my default “sudo” account. I created a 2nd user account (Standard account). While logged into the 2nd user account, if I insert a USB Flash Drive formated with ext4, then I get this message when trying to access files on the drive: This […]
X- ITM

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware

.

X ITM