LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   help logging in to linux ftp server (https://www.linuxquestions.org/questions/linux-newbie-8/help-logging-in-to-linux-ftp-server-618006/)

cj4331 02-01-2008 02:45 PM

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

comprookie2000 02-01-2008 03:12 PM

Do you have physical access to the box? Or can you ssh or telnet to it?

cj4331 02-02-2008 11:23 AM

I have physical access to the box and can login to the box as root.

b0uncer 02-02-2008 11:57 AM

Quote:

Originally Posted by cj4331 (Post 3042815)
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.

cj4331 02-02-2008 12:12 PM

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?

v00d00101 02-02-2008 12:28 PM

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.

novent 02-02-2008 12:35 PM

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

cj4331 02-02-2008 07:58 PM

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.

alan_ri 02-03-2008 11:02 AM

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.

cj4331 02-03-2008 07:23 PM

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.

JWPurple 02-03-2008 09:54 PM

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.

alan_ri 02-04-2008 06:41 AM

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.

cj4331 02-04-2008 09:09 AM

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.

alan_ri 02-04-2008 10:26 AM

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!

cj4331 02-04-2008 10:54 AM

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.


All times are GMT -5. The time now is 06:14 PM.