LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 04-12-2009, 02:38 AM   #1
ximpda
LQ Newbie
 
Registered: Apr 2009
Posts: 6

Rep: Reputation: 0
Cannot modify sshd_config [Operation not permitted]


I've recently been getting SSH brute force attacks on port 22 and i'd like to change the SSH port.

However, i cannot modify nor change permissions for sshd_config file under /etc/ssh

Tried changing the immutable attribute using
Code:
chattr -i sshd_config
But didnt help.

I still cant save the file from vi editor.
chmodding it doesnt help either.

Code:
[root@YSD001 ssh]# lsattr sshd_config
-u---a------- sshd_config
Code:
[root@localhost ssh]# chmod 666 sshd_config
chmod: changing permissions of `sshd_config': Operation not permitted

[root@localhost ssh]# sudo chmod 666 sshd_config
chmod: changing permissions of `sshd_config': Operation not permitted
I'm logged in as root, and modify and change files daily. I dont know why its not working on this particular file ?

Any help would be greatly appreciated.

Last edited by ximpda; 04-12-2009 at 02:52 AM.
 
Old 04-12-2009, 03:04 AM   #2
Roflcopter
LQ Newbie
 
Registered: Dec 2008
Distribution: Windows XP / Ubuntu 8.10 / Fedora 10
Posts: 22

Rep: Reputation: 16
i'm a linux noob and I've never had this happen to me, but can you change the permissions of sshd_config while the sshd daemon is running?
 
Old 04-12-2009, 03:10 AM   #3
ximpda
LQ Newbie
 
Registered: Apr 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Roflcopter View Post
i'm a linux noob and I've never had this happen to me, but can you change the permissions of sshd_config while the sshd daemon is running?
I Guess you might be right. But how can i turn off the sshd daemon and still control the server remotely ?
 
Old 04-12-2009, 03:21 AM   #4
ximpda
LQ Newbie
 
Registered: Apr 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Other flags had to be removed as well via chattr -ua sshd_config

Thanks anyway.
Worked.
 
Old 04-12-2009, 03:27 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
i'm a linux noob and I've never had this happen to me, but can you change the permissions of sshd_config while the sshd daemon is running?
yes

which distribution are you using?
Can you change other files in that directory?

try

Code:
chattr -u -a sshd_config
 
Old 04-12-2009, 03:29 AM   #6
Roflcopter
LQ Newbie
 
Registered: Dec 2008
Distribution: Windows XP / Ubuntu 8.10 / Fedora 10
Posts: 22

Rep: Reputation: 16
- removed -

Last edited by Roflcopter; 04-12-2009 at 03:30 AM.
 
  


Reply



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
-bash: ulimit: open files: cannot modify limit: Operation not permitted pjglinuxq Linux - Server 3 06-11-2010 06:19 AM
Operation not permitted prasunhowlader Linux - Newbie 3 08-20-2008 09:29 PM
ulimit: max user processes: cannot modify limit: Operation not permitted farnaw4u Linux - Newbie 3 04-21-2008 06:32 AM
su - operation not permitted jrtayloriv Linux - Newbie 2 06-09-2005 09:27 PM
Operation not permitted FrozenShadow23 Linux - Newbie 6 10-05-2003 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:25 AM.

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
Open Source Consulting | Domain Registration