Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-11-2007, 04:43 AM   #1
LQ Newbie
Registered: Sep 2002
Posts: 12

Rep: Reputation: 0

I am trying to restrict root access to 2 IP addresses and of course to localhost. All other machines cannot login to the machine through root user.

I am logged into 4 machines:

I should only be allowed to type in ssh root@ from user3@ and user2@

I tried putting this in /etc/security/access.conf:
+ : root :
- : root : ALL

But I still can't login root@ from and

1. Are the above 2 lines correct?
2. What should they be if they are wrong.

I am using Redhat Linux 7.3
Old 10-11-2007, 04:52 AM   #2
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I'm on really shakey ground here, but is /etc/security/access.conf even relevant for ssh? I have my specific ssh allowed users, etc in /etc/ssh/sshd_config
Old 10-11-2007, 12:20 PM   #3
LQ Newbie
Registered: Sep 2002
Posts: 12

Original Poster
Rep: Reputation: 0
Can you show me how to configure the sshd_config file.

From user1@, a bash script logs in root@ to change file permisions such as owner, group in the latter server.
But audit says you should not log in remotely as root, so I was wondering what the solution should be? From user1@, perhaps I can log in as user0@ then I will have to figure how to su - root without entering the password.
Old 10-12-2007, 01:48 AM   #4
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,308

Rep: Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744
To avoid remote doing login as root, login as normal user then either:

1. su -
which will take you to root user (need root passwd)
2. sudo su -
which will take into root, need your normal user passwd
for this you need to use visudo to setup sudo file first.


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
Restrict X server access using /etc/security/access.conf anand_kt Linux - General 0 04-22-2005 08:40 AM
can't access /etc/resolv.conf woodland56 Linux - Networking 1 03-06-2005 05:11 PM
how do i modify my smb.conf to allow anyone access ... Lleb_KCir Linux - Software 4 11-27-2004 04:55 PM
how to access and change grub.conf? kamaboko Linux - Newbie 2 04-24-2004 05:37 AM
lilo.conf and grub.conf no read access shanenin Linux - Software 1 10-02-2003 03:53 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:45 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration