LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 12-16-2006, 02:11 AM   #1
LOLobo
Member
 
Registered: Dec 2004
Location: Los Angeles
Distribution: Slackware 10.0 & 11.0
Posts: 31

Rep: Reputation: 16
Cannot edit sshd_config as root


Code:
[ Cannot open file for writing: Permission denied ]
Receiving this message in pico (and something similar in vim) when trying to save after having edited /etc/ssh/sshd_config.

I had edited and saved it before and added an extra listening port, however, noticed recently that the extra port was no longer working, and no longer was reflected in the sshd_config, also notice the date on the file remained that of date which it was last successfully edited.

Code:
ls -lh /etc/ssh/
total 148K
-rw-r--r--  1 root root 110K 2004-04-23 15:00 moduli
-rw-r--r--  1 root root 1.4K 2004-04-23 15:00 ssh_config
-rw-------  1 root root  672 2005-05-16 22:43 ssh_host_dsa_key
-rw-r--r--  1 root root  604 2005-05-16 22:43 ssh_host_dsa_key.pub
-rw-------  1 root root  529 2005-05-16 22:43 ssh_host_key
-rw-r--r--  1 root root  333 2005-05-16 22:43 ssh_host_key.pub
-rw-------  1 root root  887 2005-05-16 22:43 ssh_host_rsa_key
-rw-r--r--  1 root root  224 2005-05-16 22:43 ssh_host_rsa_key.pub
-rw-r--r--  1 root root 3.0K 2006-09-06 10:29 sshd_config
Please advise. I cannot delete, edit, or overwrite this file, however I can create new files in the same directory, and edit those. I'd prefer to not have sshd utilize a different config file. I want to successfully edit and save this file.
 
Old 12-16-2006, 02:49 AM   #2
fvu
LQ Newbie
 
Registered: Nov 2006
Distribution: Ubuntu 7.10
Posts: 28

Rep: Reputation: 15
Are you sure you're editing the file as root, like in: sudo vim /etc/ssh/sshd_config?

Freddy Vulto
http://fvue.nl
 
Old 12-16-2006, 01:09 PM   #3
LOLobo
Member
 
Registered: Dec 2004
Location: Los Angeles
Distribution: Slackware 10.0 & 11.0
Posts: 31

Original Poster
Rep: Reputation: 16
This:
Code:
sudo vim /etc/ssh/sshd_config
Is resulting in this:
Code:
/etc/ssh/sshd_config" E212: Can't open file for writing
 
1 members found this post helpful.
Old 12-16-2006, 03:15 PM   #4
LOLobo
Member
 
Registered: Dec 2004
Location: Los Angeles
Distribution: Slackware 10.0 & 11.0
Posts: 31

Original Poster
Rep: Reputation: 16
Figured it out by reading other posts on this same forum....
lsattr & chattr (which I've only previously used in eggdrops)

Code:
root@localhost:/etc/ssh# lsattr
su--ia------- ./sshd_config
------------- ./moduli
------------- ./ssh_host_key
su--ia------- ./ssh_config
------------- ./ssh_host_key.pub
------------- ./ssh_host_dsa_key
------------- ./ssh_host_dsa_key.pub
------------- ./ssh_host_rsa_key
------------- ./ssh_host_rsa_key.pub
------------- ./sshd_config_new
Code:
root@localhost:/etc/ssh# chattr -V -ia sshd_config
chattr 1.35 (28-Feb-2004)
Flags of sshd_config set as su-----------
Code:
root@localhost:/etc/ssh# lsattr
su----------- ./sshd_config
------------- ./moduli
------------- ./ssh_host_key
su--ia------- ./ssh_config
------------- ./ssh_host_key.pub
------------- ./ssh_host_dsa_key
------------- ./ssh_host_dsa_key.pub
------------- ./ssh_host_rsa_key
------------- ./ssh_host_rsa_key.pub
------------- ./sshd_config_new
Code:
root@localhost:~# chattr -V +ia /etc/ssh/sshd_config
chattr 1.35 (28-Feb-2004)
Flags of /etc/ssh/sshd_config set as su--ia-------
 
  


Reply

Tags
slackware, sshdconfig


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
Edit /ect/profile with root? Tony33221 Linux - Security 11 09-04-2005 07:02 PM
Elementary Question - Can't Edit File - Need Root rrrssssss Linux - Newbie 2 04-12-2005 04:05 AM
how to edit a file without logging in as root? osat3ch Fedora 3 08-22-2004 12:16 AM
quick sshd_config question slug420 Linux - Security 1 08-10-2004 12:39 PM
sshd_config eyt Linux - Newbie 2 02-19-2004 01:05 PM


All times are GMT -5. The time now is 06:23 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration