garycooke
Posts: 79
Joined: Wed Feb 12, 2014 10:38 am

sshd config file

Fri Mar 21, 2014 12:21 am

can anyone tell me what line 1 of the sshd config file should say please, i tried to make a change (below)

sudo nano /etc/ssh/sshd_config (and then a number)

when i boot the pi now i get the line below towards the end of booting up

Starting open BSD secure shell server:sshd/etc/ssh/sshd_congfig:line1:bad configuration:Xxx/etc/ssh/sshd_config:terminating, 1 bad configuration
failed!

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: sshd config file

Fri Mar 21, 2014 12:44 am

The 1st non # line in my file is:
Port 22

For the best help, it would probably be best if you copy and paste the contents of your sshd file here using

Code: Select all

 tags and tell what you are trying to accomplish.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

garycooke
Posts: 79
Joined: Wed Feb 12, 2014 10:38 am

Re: sshd config file

Fri Mar 21, 2014 7:12 am

I had read a post someone had put and copied that line, now i get falied when i boot the pi, so i just want to put it back as it was or take the line out if anyone knows how to remove it.
I was putting a port number in so the pi could talk to the router with that port number, i have since found out my router won't let me open ports unless i get a business account with BT so the whole thing was a waist of time anyway.

garycooke
Posts: 79
Joined: Wed Feb 12, 2014 10:38 am

Re: sshd config file

Fri Mar 21, 2014 7:30 am

Now i am thinking about it, i wonder if i should get rid of the number at the end of that line, if someone can tell me how to do that please, i think that i should of typed what i did without the number then gone into that file and changed the number (ie port 22 to the port number i was using)
If i am right which i very much doubt all i need is someone to tell me how to delete that whole line i put in

Sorry again for time waisting

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: sshd config file

Fri Mar 21, 2014 1:16 pm

I am not sure what your problem is? What number at the end of what line?
Just edit the file like you did before and put it back to the way it was before, then save and exit.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: sshd config file

Fri Mar 21, 2014 2:16 pm

If you want to remove a line you added to a file, if you don't know how to delete it, then you just put a pound sign (#) at the start of the line, which turns it into a comment.

This is lesson that before you edit any system files, it is wise to make a backup of them so if something gets broken, you still can use the old file.

cp -p oldfilename oldfilename.bak

If you want to remove something at the end of a line, how to do that depends on what text editor you are using. In some, all you have to do is go into the file and backspace over the words or characters you want to remove, and save the file. In vi, you position the cursor on the line, and to delete the line, type :d if you are not in visual mode.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

garycooke
Posts: 79
Joined: Wed Feb 12, 2014 10:38 am

Re: sshd config file

Fri Mar 21, 2014 3:18 pm

i just typed the line that started with sudo nano and like an idiot put a port number at the end of it instead of in the file, now i am getting a failed message, i know it's to do with what i have done.
i was in home/pi and am unsure where this file was saved, once i can find where the line is i will delete it

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: sshd config file

Fri Mar 21, 2014 6:44 pm

try running the following to check the most recently changed files:

ls -alt /home/pi/*
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

Return to “Beginners”