LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-01-2008, 03:45 PM   #1
cj4331
Member
 
Registered: Feb 2008
Posts: 30

Rep: Reputation: 15
help logging in to linux ftp server


We have a linux server here at the office that nobody here now knows anything about--and I mean nobody knows anything about Linux here. We need to get an ftp connection to it. I think it's running tftp. I know when I use my Windows FTP software it connects to it and prompts for user and password. I type in root and root's password but it says the login is incorrect. How can I check the setup on the linux box to setup the root account, or fix it, or whatever. If you need versions etc please advise how to get them 'cause I really don't know anything about Linux. I'm willing to learn but I'm on a tight time table here.

Thanks,
CJ
 
Old 02-01-2008, 04:12 PM   #2
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 56
Do you have physical access to the box? Or can you ssh or telnet to it?
 
Old 02-02-2008, 12:23 PM   #3
cj4331
Member
 
Registered: Feb 2008
Posts: 30

Original Poster
Rep: Reputation: 15
I have physical access to the box and can login to the box as root.
 
Old 02-02-2008, 12:57 PM   #4
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
Originally Posted by cj4331 View Post
I type in root and root's password but it says the login is incorrect.
It should; ftp (as such) is very unsecure, and if it allowed you to log in as root, you would practically expose your root login information to anyone accessing the network who had some interest towards the matter. Shortly put, root should never log in to the machine via any unsecure method, like ftp, or by any remote connection if you ask me. Logging in as root locally (physically connected, not over the network) should be avoided too, if possible. All the things you need to do as root can be done by logging in as a non-root user and then using su/sudo. Though if you telnet'ed to the machine as anyone, and then use su/sudo, you'd be in trouble again (telnet is bad, security-wise).

So: if you know any regular user account, use that when ftp'ing. If not, create one, and try to configure it so that that user account has as little permissions on the machine as possible, while still being able to do the job. Log into the server via ssh, or preferrably locally, and if there isn't yet, create a new user account for ftp connections, then set a password for that user account, and use it to connect to the machine.
 
Old 02-02-2008, 01:12 PM   #5
cj4331
Member
 
Registered: Feb 2008
Posts: 30

Original Poster
Rep: Reputation: 15
B0uncer, your a bit over my head but I can say security is not an issue in this case at all. Given my abilities on Linux are very limited what is the quickest way to allow root to login via ftp? Is there some kind of setup program I can run? Where would it be located?
 
Old 02-02-2008, 01:28 PM   #6
v00d00101
Member
 
Registered: Jun 2003
Location: UK
Distribution: Fedora 8, Centos 5.1
Posts: 480

Rep: Reputation: 30
Post back with exactly which FTP server program is being used, for starters.

Possible's include, VSFTPD, ProFTPD, and PureFTPd.

Then we can tell you which files to edit.

Can i make a suggestion though. If you intend to allow root to access the box, then implement SFTP or FTP over SSL.
 
Old 02-02-2008, 01:35 PM   #7
novent
LQ Newbie
 
Registered: Jan 2008
Posts: 7

Rep: Reputation: 0
Easy

Without throwing security to the wind, you could also just use the root account by configuring the ftpd.conf file correctly. Do you know which FTP service you are using? proftp, vsftp ? you can find out by using this command. chkconfig --list | grep ftp. Once you have that you can configure root to be "chroot" to its home directory. Most concern is if this is directly accessible from the internet or internal use only. If nobody knows anything about this box then you should really look at investing the time/money to either learn it or get rid of it. Simply for the reason that if nobody knows anything about it also means that nobody is able to monitor it. Whoever installed it could be accessing it and you'd never know abou it.

here is a good walkthrough for the ftp.conf

http://www.gsp.com/cgi-bin/man.cgi?s...opic=ftpd.conf
 
Old 02-02-2008, 08:58 PM   #8
cj4331
Member
 
Registered: Feb 2008
Posts: 30

Original Poster
Rep: Reputation: 15
We are getting rid of it. Just as soon as we get some files off it. It's a long story and please don't hold it against me that it is on the way out. I like Linux but MS is what my employer likes and they are the ones paying me. This is Red Hat Linux and I think it's version 6. I think the ftp server is TFTP if that makes any sense to you. I will not be at the office until Monday to check on things but I'll try to answer any questions you have before then as best I can. Thanks for all the help.
 
Old 02-03-2008, 12:02 PM   #9
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
Wink

Hi !
I understand you,but you should know that Linux is not the one to be blamed here.
What I can say here is that you shouldn`t have Linux as ftp server at all if nobody in your office understand how it works.What I would like to know is why can`t you contact person who installed that server and check if the root password is corect,or just see what that person will tell you.
The best thing to do would be to create a new user,but you can`t create one since you are not the root(and that is if you can not contact the person above),but if you can:take that files out and reinstall the server(and start learning Linux) if you really need one,because maybe the one you have is zombie,or some other kind of a backdoor and maybe that`s way your root password is changed.Linux is more secure and stable server then M$ will ever be but only if you configure it good.
Try this when you try to login in that ftp server,maybe it could get you login:

username:anonymous
password:your email(or anybodys in that office)address


And this is the link
http://www.linuxhomenetworking.com/w...P_Server_Setup if you wanna learn how to setup Linux ftp server.
 
Old 02-03-2008, 08:23 PM   #10
cj4331
Member
 
Registered: Feb 2008
Posts: 30

Original Poster
Rep: Reputation: 15
Forgive me but I hate having to explain why before anyone will answer a question. I hesitated to mention that we were getting rid of it because I know folks here are linux groupies and I didn't want to offend anyone.

The company that sold us this system is out of business and has been since before I got my current job. We just got a new IT director at our company and he is a die hard Microsquish fan. They have a new gee wiz system that will use the data files being stored by the old system except that we can only get to the last months worth of these files on the main linux box. To go back further we have to use the old software that the now defunct company sold us and pull them up one at a time off the long term storage box. Since there are millions that would suck. These over 1 month old files were saved on this other linux box and we would like to copy all of the files from it to our new windows system including the directory structure they are contained in. With the current months data I connected to the main box by ftp and selected the directory the files were under and said copy and in maybe a half hour we had them. Now when I tried to connect to the long term storage box via ftp I discover the password for root will not allow us to login to it. I can physically go to the box and login as root using that password and see the files I want but I can not use connect to that box via ftp to copy those files off.

So now that I've explained why can we get to how can I get into that Red Hat linux box via ftp as root. I don't care about security. Once this info is copied that system will be thrown in the dumpster.
 
Old 02-03-2008, 10:54 PM   #11
JWPurple
Member
 
Registered: Feb 2008
Posts: 67

Rep: Reputation: 17
Can you try the old "sneakernet" solution here? That is, use a flash drive, cd-rom, etc. to copy the files? That might be the quickest.

Otherwise you might consider setting up a non-root user and ftp as that user. Make the files available to the new user by putting them in /tmp and change access perms with chmod so the user can read them.
 
Old 02-04-2008, 07:41 AM   #12
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
If you have VSFTP,

FTP Users with Read-Only Access to a Shared Directory

In this example, anonymous FTP is not desired, but a group of trusted users need to have read-only access to a directory for downloading files. Here are the steps:
Disable anonymous FTP. Comment out the anonymous_enable line in the vsftpd.conf file:
# Allow anonymous FTP?
# anonymous_enable=YES
Enable individual logins by making sure you have the local_enable line uncommented in the vsftpd.conf file:
# Uncomment this to allow local users to log in.
local_enable=YES
Start VSFTP.
[root@bigboy tmp]# service vsftpd start
Create a user group and shared directory. In this case, use /home/ftp-users and a user group name of ftp-users for the remote users:
[root@bigboy tmp]# groupadd ftp-users
[root@bigboy tmp]# mkdir /home/ftp-docs
Make the directory accessible to the ftp-users group:
[root@bigboy tmp]# chmod 750 /home/ftp-docs
[root@bigboy tmp]# chown root:ftp-users /home/ftp-docs
Add users, and make their default directory /home/ftp-docs:
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user1
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user2
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user3
[root@bigboy tmp]# useradd -g ftp-users -d /home/ftp-docs user4
[root@bigboy tmp]# passwd user1
[root@bigboy tmp]# passwd user2
[root@bigboy tmp]# passwd user3
[root@bigboy tmp]# passwd user4
Copy files to be downloaded by your users into the /home/ftp-docs directory.
Change the permissions of the files in the /home/ftp-docs directory to read-only access by the group:
[root@bigboy tmp]# chown root:ftp-users /home/ftp-docs/*
[root@bigboy tmp]# chmod 740 /home/ftp-docs/*
Users should now be able to log in via FTP to the server using their new usernames and passwords. If you absolutely don’t want any FTP users to be able to write to any directory, then you should set the write_enable line in your vsftpd.conf file to no:
write_enable = NO
Remember, you must restart VSFTPD for the configuration file changes to take effect.

Sample Login Session to Test Functionality

Here is a simple test procedure you can use to make sure everything is working correctly:
Check for the presence of a test file on the FTP client server.
[root@smallfry tmp]# ll
total 1
-rw-r--r-- 1 root root 0 Jan 4 09:08 testfile
[root@smallfry tmp]#
Connect to Bigboy via FTP:
[root@smallfry tmp]# ftp 192.168.1.100
Connected to 192.168.1.100 (192.168.1.100)
220 ready, dude (vsFTPd 1.1.0: beat me, break me)
Name (192.168.1.100:root): user1
331 Please specify the password.
Password:
230 Login successful. Have fun.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
As expected, you can’t do an upload transfer of testfile to bigboy:
ftp> put testfile
local: testfile remote: testfile
227 Entering Passive Mode (192,168,1,100,181,210) 553 Could not create file.
ftp>
But we can view and download a copy of the VSFTPD RPM on the FTP server bigboy:
ftp> ls
227 Entering Passive Mode (192,168,1,100,35,173)
150 Here comes the directory listing.
-rwxr----- 1 0 502 76288 Jan 04 17:06 vsftpd-1.1.0-1.i386.rpm
226 Directory send OK.
ftp> get vsftpd-1.1.0-1.i386.rpm vsftpd-1.1.0-1.i386.rpm.tmp
local: vsftpd-1.1.0-1.i386.rpm.tmp remote: vsftpd-1.1.0-1.i386.rpm
227 Entering Passive Mode (192,168,1,100,44,156)
150 Opening BINARY mode data connection for vsftpd-1.1.0-1.i386.rpm (76288 bytes).
226 File send OK.
76288 bytes received in 0.499 secs (1.5e+02 Kbytes/sec)
ftp> exit
221 Goodbye.
[root@smallfry tmp]#
As expected, an anonymous FTP fails:
[root@smallfry tmp]# ftp 192.168.1.100
Connected to 192.168.1.100 (192.168.1.100)
220 ready, dude (vsFTPd 1.1.0: beat me, break me)
Name (192.168.1.100:root): anonymous
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
ftp> quit
221 Goodbye.
[root@smallfry tmp]#
Now that testing is complete, you can make this a regular part of your FTP server’s operation.
 
Old 02-04-2008, 10:09 AM   #13
cj4331
Member
 
Registered: Feb 2008
Posts: 30

Original Poster
Rep: Reputation: 15
Begin Happy Dance.

I am the Linux master! Resistance is futile. Take that you stupid box.

End Happy Dance.

Now that I'm finished dancing. Thanks to Alan_ri. While I don't really understand what you have written, and I did mention I think I'm working with TFTP and you wrote about VSFTP, your response showed me several new commands that ended up in a 2 step process that allowed me access to the files!

useradd me
passwd me

Despite the machine groaning about my bad, short, repetitive and insecure password it did take it. Then I tried logging in as me via FTP and it worked. Thankfully I have rights to see and get the files I need.

Such a simple and seemingly obvious solution but it sure wasn't Friday. Useradd? I'd have guessed adduser. Oh well. I also must thank the others because I gleaned from your responses that apparently Linux by default or common practice prevents root from logging in via FTP. After reading Alan_ri's response this AM I figured I had nothing to loose by trying to add a new user.
 
Old 02-04-2008, 11:26 AM   #14
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
In my first post I wasn't aware that you have physical access to the box as root.A lot on my mind recently.

Happy dancing!

Last edited by alan_ri; 02-04-2008 at 11:28 AM.
 
Old 02-04-2008, 11:54 AM   #15
cj4331
Member
 
Registered: Feb 2008
Posts: 30

Original Poster
Rep: Reputation: 15
No problem. I appreciate the help. Actually getting that root password to log in was difficult and time consuming. First we asked all over and everyone tried to remember what it was. They all thought it was the same as the password on the main box. Finally I started googling forgotten linux root password and found out I could edit the startup to make it single user which was logged in as root. We then changed the password to something we knew.

I am intrigued by linux and frankly think it is worth looking into but I'm a programmer with dbase, FoxPro, and Visual Basic skills mostly and given that I tend to find work doing that. My current employer like most I've seen that hire MS programmers are MS die hards. There doesn't seem to be much hope I'll get any skills in Linux on the job and I don't have the time after hours to work on Linux. Perhaps someone can tell me if any of my .net programs will run on Linux? Will my ASP.net programs run on a Linux web server? I don't think so. So if I was to want to write a program for Linux what would I write it in? Java? Is their a visual Java available? Anyway, I really wish to stick with programming these days and move more toward web programming.
 
  


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
ftp from LInux to Serv-U ftp server problem csross Linux - General 2 11-07-2005 05:35 PM
Trouble Logging in to FTP server phatboyz Linux - Networking 6 09-02-2004 08:39 AM
logging into a linux server thru a thin client rach Linux - Networking 1 09-11-2003 04:50 PM
Logging into a Linux Server w/ Win2k chowse Linux - Networking 3 08-29-2001 12:34 PM


All times are GMT -5. The time now is 12:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration