USA Linux Users Group Forum Index
Log in Register FAQ Memberlist Search USA Linux Users Group Forum Index Album

Starting services automatically

 
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » OTHER
View previous topic :: View next topic  
Author Message
Jonathan
New Member


Joined: 10 Jan 2024
Posts: 19

PostPosted: Sat May 24, 2024 9:00 pm    Post subject: Starting services automatically Reply with quote

Hi all. I have Fedora 8 installed on one of my machines. I currently have mysql and ssh working when I log in as root and I can use a client like putty to connect to this box from another pc. I want to start mysqld and sshd automatically when the machine is booted up so that I don't have to log in as root and stay logged in. I edited /etc/rc.local with vi and added the following two lines:
service sshd start
service mysqld start

I made sure to save the edited file and used 'more rc.local' to confirm before I rebooted. However, I still must log in as root before I can connect from another machine. How do I remedy this?

Thanks!

Jonathan


Back to top
View user's profile Send private message
Jonathan
New Member


Joined: 10 Jan 2024
Posts: 19

PostPosted: Sat May 24, 2024 11:53 pm    Post subject: Reply with quote

Also I checked in the directory /etc/init.d and there are scripts (or links to scripts???) for mysqld and sshd. I've used search engines to find similar postings by Linux users and everything I've been able to find falls under three categories:
1. edit /etc/rc.local
2. make sure there's a script in /etc/init.d
3. use the GUI and start the service, make sure the runlevels I want are checked and Save it

None of this allows me to use a putty client to connect to the machine and use mysql.


Back to top
View user's profile Send private message
crouse
Site Admin


Joined: 17 Apr 2024
Posts: 11833
Location: Iowa

PostPosted: Sun May 25, 2024 1:35 am    Post subject: Re: Starting services automatically Reply with quote

Jonathan wrote:
However, I still must log in as root before I can connect from another machine. How do I remedy this?


Not sure where the ssh config file resides....... in Arch it's

/etc/ssh/sshd_config ....... but fedora it's probably in a different place........ find it, make sure that you edit the line that says "Allowed Users" or something like that.......and add your user to there to allow them to connect. Fedora might also have an "ssh group" ....... not sure. If so, make sure your added to the group.



_________________
Veronica - Arch Linux 64-bit -- Kernel 2.6.33.4-1
Archie/Jughead - Arch Linux 32-bit -- Kernel 2.6.33.4-1
Betty/Reggie - Arch Linux (VBox) 32-bit -- Kernel 2.6.33.4-1
BumbleBee - OpenSolaris-SunOS 5.11
Back to top
View user's profile Send private message Visit poster's website AIM Address
Jonathan
New Member


Joined: 10 Jan 2024
Posts: 19

PostPosted: Sun May 25, 2024 2:59 am    Post subject: Reply with quote

Thank you for your response. However I can't find any listing in the sshd_config or ssh_config files that resembles "allow user x". If you like I can post a copy of the contents of that file if that would help.

Jonathan


Back to top
View user's profile Send private message
jester
Sr. Member


Joined: 19 Apr 2024
Posts: 1166

PostPosted: Sun May 25, 2024 3:42 am    Post subject: Reply with quote

Jonathan: I had a look around the Fedora forums but found nothing especially clear or straightforward so I'm referring you to the ArchWiki
AllowUsers is a line that you'll have to manually add (unless FC8 has some whizz-bang GUI thinger) with a text editor.

The linked page is quite clear I think.

Hope it works for you



_________________
Arch64 :: Funtoo64 :: FreeBSD-8.0 :: OSX-10.4.11 (PPC)
Testing: Fedora12_x86-64 :: Ubuntu-10.04-LTS_x86-64
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Jonathan
New Member


Joined: 10 Jan 2024
Posts: 19

PostPosted: Sun May 25, 2024 6:06 am    Post subject: Reply with quote

Thanks, jester. The linked page was very clear and straightforward enough to follow. However after doing all that it still doesn't work for me. Or, more correctly, I can only connect to the machine if I first log in to it as root.
The only thing different for me than what I found on that page was that I don't have a rc.conf file. I'm supposed to make an entry in that file that starts the ssh daemon but I don't have that file; however there is a listing for sshd in /etc/init.d and I would think that would start the daemon on bootup.

I'm don't know what else I can do at this point; any further suggestions?

Thank you,

Jonathan


Back to top
View user's profile Send private message
jester
Sr. Member


Joined: 19 Apr 2024
Posts: 1166

PostPosted: Sun May 25, 2024 6:30 am    Post subject: Reply with quote

what happens if you do the following (as su or root):
Code:
/etc/init.d/sshd restart



_________________
Arch64 :: Funtoo64 :: FreeBSD-8.0 :: OSX-10.4.11 (PPC)
Testing: Fedora12_x86-64 :: Ubuntu-10.04-LTS_x86-64
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
pbharris
Member


Joined: 02 Jul 2024
Posts: 320
Location: chicago

PostPosted: Sun May 25, 2024 7:01 am    Post subject: Reply with quote

hello Jonathan -
you can run serviceconf to select what starts up automatically.

you can also add links to the proper service in the runlevel you are booting to
for sshd this would be

ln -s /etc/init.d/sshd /etc/rc5.d/S55sshd
ln -s /etc/init.d/mysqld /etc/rc5.d/S56mysqld

assuming your are in run level 5 - if you boot into a non-GUI item change the rc5.d to rc3.d



_________________
Fedora
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Jonathan
New Member


Joined: 10 Jan 2024
Posts: 19

PostPosted: Sun May 25, 2024 1:02 pm    Post subject: Reply with quote

Hi, jester. When I type that command I get the following:
Stopping sshd: [ OK ]
Starting sshd: [ OK ]

Hi, pdharris. I added those two symbolic links and when I ran serviceconf it opened the GUI I first used to try setting sshd to run automatically. Unfortunately this didn't work either.

Thank you both for your help.

Jonathan

[/b]


Back to top
View user's profile Send private message
Jonathan
New Member


Joined: 10 Jan 2024
Posts: 19

PostPosted: Wed Jun 04, 2024 1:46 pm    Post subject: Reply with quote

Update:

I've paid attention to the info on the screen during boot and I've seen the following line scroll up: 'Starting sshd [OK]'. This tells me that the ssh daemon is starting properly. Then eventually a text login prompt appears and, about 1 second later, the screen clears and a graphical login prompt starts loading.

I theorize that whatever script or option that causes Fedora 8 to auto-start the X11 server and give the gui login may be stopping the ssh daemon (among others???). I've tried to find a way from the gui desktop to choose a text login - not even have the X11 server start which would be my preference anyway - but I can't find it.

How can I choose a text login instead of a gui?

Also, is there a way to edit the script that auto-starts the X-11 server and tell it to also start sshd?


Back to top
View user's profile Send private message
Germ
Keeper of the BIG STICK


Joined: 30 Apr 2024
Posts: 12452
Location: Planet Earth

PostPosted: Wed Jun 04, 2024 2:28 pm    Post subject: Reply with quote

Well, fedora should have chkconfig so...
Code:
chkconfig sshd on
chkconfig mysqld on

That should start them at boot.


This will give you a list of services and their status:
Code:
chkconfig --list


see the man page for more options.



_________________
Laptop: Mandriva 2024 PowerPack - 2.6.33.5-0.2mnb
Desktop: Mandriva 2024 Free - kernel 2.6.33.2-1mib
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
jester
Sr. Member


Joined: 19 Apr 2024
Posts: 1166

PostPosted: Wed Jun 04, 2024 2:46 pm    Post subject: Reply with quote

Jonathan wrote:
Hi, jester. When I type that command I get the following:
Stopping sshd: [ OK ]
Starting sshd: [ OK ]

Did you do this from a terminal under the GUI? If so, then X is not a factor.

I don't have a wealth of experience with fedora but I'm wondering if the SE settings have something to do with this - i.e. maybe it won't allow you to use the SSH default port 22 because it is too often the entry point for unwanted 'guests' or maybe you need to modify iptables to 'punch a hole' through to allow access...?

Just noticed that Germ has posted so try his suggestion to confirm


Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Jonathan
New Member


Joined: 10 Jan 2024
Posts: 19

PostPosted: Sun Jun 08, 2024 6:28 am    Post subject: Reply with quote

Hi all,

I've resolved the issue in a way. Since I just got a new computer a month or so ago I decided to wipe the hard drive on the old one, which was a dual boot setup with WinXP and Linux, and just run Linux on it. I decided to take the time to download all the images for CDs instead of using the Live CD I already have and which I used to install Fedora 8 before. I did this because I had a weird theory that my problems stemmed from the live cd installation - crazy idea but I'm a relative newb so I'm entitled Very Happy he he.

Anyway, after installing from the CDs I started sshd and set it to run in runlevels 2 through 5 (using the gui on the gnome desktop), logged out and got the gui login screen, then connected to it from my Windows pc. Success!

So, since I'm a sucker for punishment I wiped the hard drive, installed from the live cd, started sshd and set it to run in runlevels 3 through 5 (using gnome's gui - only 3 through 5 are offered in this gui instead of 2 through 5 ???), connected successfully from Windows pc, logged out, could NOT connect from Windows pc.

Then wiped hard drive (I've got lots of free time) and reinstalled from the CDs. Success again.

So, problem solved on my end. I'm just curious about a few things. Why DOESN'T setting the runlevels on the Live CD install work and the Normal CD DOES work? Why the different Services gui (on gnome desktop both times) between Live CD install and Normal Cd install? Why the different login gui between them since they're both Fedora 8? Why am I so punchy at 2:30 am EST after 2 liters of CocaCola and a bag of cheetos Surprised (I'm a wobbly, not a skinny)? Keep in mind these questions aren't complaints, just curiosity.


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » OTHER All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All content © 2024-2009 - Usa Linux Users Group
This forum is powered by phpBB. © 2024-2009 phpBB Group
Theme created by phpBBStyles.com and modified by Crouse