PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Linux-VMWare - per FTP als root verbinden geht nicht



MacGyverDTH
08.05.09, 09:37
Hallo zusammen !

Ich bin ein Linux Neuling und habe nun (aus geschäftlichen Gründen) RedHat4 in einer VM-Ware laufen und installiert. Dies hat soweit geklappt und ich habe es auch geschafft den FTP und Telnet Server zu installieren. Mit einem FTP Programm kann ich mich in Linux anmelden (mit meinem "normalen" user und dessen Passwort) und somit Dateien hin und herschieben. Aber wenn ich mich mit "root" per FTP einloggen will kommt immer nur "permission denied". Wie kann ich root freischalten damit ich auch per ftp mich als root einwählen kann ?

Ich hoffe ihr könnt mir da ein wenig weiterhelfen, bin leider noch ein Linux Anfänger und bin noch sehr am kämpfen mit diesem neuen Betriebssystem.

vielen Dank schonmal, Gruß,
Mac

marce
08.05.09, 09:45
root und ftp bzw. telnet ist keine gute Idee - das Passwort geht im Klartext über's Netz. Telnet ist generell keine gute Idee. SSH/SCP sind eigentlich eher die Mittel der Wahl...

Für's experimetieren - klar, kann man machen - meist ist die entsprechende Einstellung in der Konfiguration des FTP-Servers zu finden.

MacGyverDTH
08.05.09, 09:53
Danke für den Hinweis (PW im Klartext...), das wusste ich nicht. Aber das ist ein PC der nicht am Netz hängt und nur von Windows nach Linux Daten übertragen soll. Es ist eine absolute Testumgebung, also Sicherheitstechnisch wäre das nicht so schlimm. Ich habe eine Linux-VM die ich nun nachbauen möchte (um Linux zu lernen) und da hatte dies funktioniert.

Ich habe unter Systemeinstellungen - Servereinstellungen keinen Eintrag mit FTP-Server. Wo kann ich den FTP Server unter RedHat4 einstellen/bearbeiten ? (ich habe da nur Dienste, HTTP, NFS und Samba).

marce
08.05.09, 09:57
Es gibt zu jedem Dienst (mindestens) eine Konfigurationsdatei. Wo die liegt und wie sie heißt hängt vom verwendeten FTP-Server ab.

"vermutlich" findet sich die Datei unter /etc - genaueres kann man aber erst sagen wenn wir den verwendeten Server kennen.

Da Du RHEL verwendest kann auch zusätzlich noch SELinux ein bisschen mitspielen...

MacGyverDTH
08.05.09, 10:11
Also soweit ich das sehe habe ich vsftpd als Server laufen, den habe ich mal in den Diensten gefunden. In /etc/vsftpd gibt es auch eine vsftpd.conf Datei, aber in der habe ich nichts gefunden das root aussperrt oder ähnlich...

Was ist SELinux ?

marce
08.05.09, 10:12
(1) Poste doch mal die Konfigurationsdatei - verwende dafür bitte die
$Datei -Tags.

(2) was ist Google?

MacGyverDTH
08.05.09, 10:31
1)

# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that turning on ascii_download_enable enables malicious remote parties
# to consume your I/O resources, by issuing the command "SIZE /big/file" in
# ASCII mode.
# These ASCII options are split into upload and download because you may wish
# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES

pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES


Aber ich denke daran liegt es nicht, ich habe mal die .conf von dem System das ich nachbilden will genommen, dann läuft es aber auch nicht. Ich denke das ich irgendwo an einer anderen Stelle was ändern muß.

2) jaja, hast ja recht ... ;-)

marce
08.05.09, 10:36
userlist_enable=YES
dürfte der Schuldige sein.
http://vsftpd.beasts.org/vsftpd_conf.html


2) jaja, hast ja recht ... ;-)
Google zu benutzen und Doku zu lesen gehört zum 1x1 eines Admins. Du bist einer :-)

MacGyverDTH
08.05.09, 10:55
Also mit "userlist_enable=NO" kommt nun die Fehlermeldung: "Login incorrect" - das Passwort stimmt aber, habe es mehrfach getestet.

Ich habe gerade gemerkt das ich auch mit Telnet nicht mit "root" einwählen kann, nur mit dem normalen Benutzer... Bei Telnet kommt mit root auch "Login incorrect".


Google zu benutzen und Doku zu lesen gehört zum 1x1 eines Admins. Du bist einer :-)
Stimmt, nur manchmal siegt die faulheit einfach mal nachzufragen, obwohl einem google meistens schneller helfen kann da man dort meist sofort eine Antwort erhält... Aber hast recht, werde in Zukunft erstmal google bei so Sachen fragen.

MacGyverDTH
08.05.09, 11:14
Ich habe die Lösung gefunden ! (mit google, aber auch durch dein Tipp mit den users):

FTP mit root:
in den Dateien "etc/vsftpd.ftpusers" und "etc/vsftpd.user_list" muß "root" entfernt werden.

Telnet mit root:
in der Datei "etc/securetty" muß "pts/0" dazugeschrieben werden für eine erlaubte Instanz, wenn es zwei sein sollen dann noch "pts/1" usw.

dann geht jeweils die Verbindung mit root !
Danke für deine Hilfe !

marce
08.05.09, 11:18
ich würde Dir aber trotzdem nahelegen, Dir ernsthaft zu überlegen, ob Du wirklich

- ftp u. telnet brauchst (anstatt die sicheren SSH / SCP-Alternativen zu verwenden)
- _wirklich_ root-Zugriff benötigst.

Klar - es ist ein Testsystem. Aber solche Dinge sind eigentlich NoGos - und was man sich mal "angewöhnt" hat legt man gerne nicht mehr ab.

MacGyverDTH
08.05.09, 11:35
Da hast du schon recht das man das nicht machen sollte um sich nicht so Sachen anzugewöhnen. Leider kenn ich mich mit "SSH / SCP" momentan noch nicht wirklich aus, da werde ich mich dann mal reinlesen müssen wie das damit funktioniert... solange werde ich noch diese NoGo-Methode benutzen müssen.

Ich werde mich mal damit beschäftigen und wenn ich nicht klarkomme habe ich ja jetzt ein tolles Forum gefunden bei man mir dann weiterhelfen kann. Danke das du nochmals darauf hingewiesen hast das dies ein NoGo ist und ich es mir wirklich überlegen sollte es nicht doch zu ändern.

marce
08.05.09, 11:37
Viel ändert sich durch die Benutzung von ssh nicht - anstatt telnet schreibst Du ssh, anstatt eines Telnetservers musst Du einen ssh-Server installieren. Der dürfte, im Gegensatz um Telnetserver, normalerweise auch schon per default am laufen sein und installiert sein.

MacGyverDTH
08.05.09, 13:20
OK, kennst du auch noch eine kostenlose SSH-Client Software für Windows (im Bestfall sogar eine ohne Installation - also StandAlone) ? Dann kann ich das gleich am Wochenende mal durchtesten und künftig damit arbeiten.

Wenn du natürlich auch noch eine kostenlose SCP-Software für Windows kennst würd ich auch nicht nein sagen (in google findet man da immer so viel das man nicht weiß was man nehmen soll und auch nie weiß welche was taugen...)

marce
08.05.09, 13:47
WinSCP, PuTTY, ...

MacGyverDTH
08.05.09, 15:17
Super. Vielen Dank.