LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-12-2019, 03:42 AM   #1
ttpp
LQ Newbie
 
Registered: Jul 2019
Posts: 24

Rep: Reputation: Disabled
Not able to save changes to sshd_config file


I used nano and was able to make "and" save the changes. But I created a sshd_config.save file that I am not able to delete. How can I delete it?

Last edited by ttpp; 07-12-2019 at 04:47 PM. Reason: clarify question
 
Old 07-12-2019, 10:18 AM   #2
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,215

Rep: Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104
Welcome to LQ

/etc/sshd_config is owned by root, and must be edited by root. Do you know how to do that?
 
Old 07-12-2019, 11:30 AM   #3
ehartman
Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 672

Rep: Reputation: 317Reputation: 317Reputation: 317Reputation: 317
Quote:
Originally Posted by scasey View Post
/etc/sshd_config is owned by root, and must be edited by root.
And actually you shouldn't even be able to edit (read) it as a non-root user:
Code:
 $ ls -l /etc/ssh/sshd_config
-rw-r----- 1 root sys    3432 2018-03-08 02:25:00 sshd_config
so it's not readable for "other" users (and even the change of group to "sys" is already my own modification as I made myself part OF that group as to be able to read, but not modify, system files).
 
Old 07-12-2019, 04:46 PM   #4
ttpp
LQ Newbie
 
Registered: Jul 2019
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thanks.

"sudo nano /etc/ssh/sshd_config" = modified the file

But a 2nd file was created in the process: "sshd_config.save" I modified this file as well so that the 2 files are identical, but I would like to delete it as it wasn't there before I made changes to the sshd file.
 
Old 07-12-2019, 05:07 PM   #5
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,215

Rep: Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104Reputation: 1104
Quote:
Originally Posted by ttpp View Post
Thanks.

"sudo nano /etc/ssh/sshd_config" = modified the file

But a 2nd file was created in the process: "sshd_config.save" I modified this file as well so that the 2 files are identical, but I would like to delete it as it wasn't there before I made changes to the sshd file.
Why? It never hurts to have a backup copy.

That said, same answer. If it's owned by root, you'll need to be root to delete it.
 
Old 07-13-2019, 01:25 AM   #6
ttpp
LQ Newbie
 
Registered: Jul 2019
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thanks.
 
  


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
Not able to save crontab changes surya24d Linux - Newbie 2 02-24-2016 05:23 AM
sshd_config changes to updated sshd package. dowelld Slackware 66 02-07-2016 07:40 AM
SSH: sshd_config changes: restart? Linux_Kidd Linux - Software 2 05-22-2013 01:48 PM
[SOLVED] Cannot able to do ssh after doing changes in /etc/ssh/sshd_config suboss87 Linux - Security 2 09-05-2012 11:15 PM
not being able to save changes in /etc/resolv.conf b0nd Slackware 6 03-03-2006 11:48 PM

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

All times are GMT -5. The time now is 09:35 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