FTP/Telnet  User Adminitration

Hi, apparently both my FTP & Telnet services are running
<<STATE STIME FMRI
online 2:03:46 svc:/network/ftp:default
root@new-host # svcs telnet
STATE STIME FMRI
online 2:03:46 svc:/network/telnet:default
>>
Could somone please let me know how to give users rights to ftp/telnet to the machine? When I try to ftp to the machine I get an error that the password is incorrect. I am trying to log on as root first, to make sure that it works, and then I will start trying to log on withactual user names. Thank You Alex Tl

root is not allowed to log in by ftp. You need to add non-root users.
It is controlled by:
bash-3.00# cat /etc/ftpd/ftpusers
# ident "@(#)ftpusers   1.5     04/02/20 SMI"
# List of users denied access to the FTP server, see ftpusers(4).
root
daemon
bin
sys
adm
lp
uucp
nuucp
smmsp
listen
gdm
webservd
nobody
noaccess
nobody4

Similar Messages

  • Enable ftp/telnet Solaris 10

    Hi,
    I�m trying to enable ftp/telnet in Solaris 10, this is my first time i use solaris 10, could you help me please?

    Hi ;
    I have the same problem i could not enable telnet and inetd, also why i try with this command it shows me:
    # svcs -x telnet
    svc:/network/telnet:default (Telnet server)
    State: uninitialized since Tue Oct 09 13:37:00 2007
    Reason: Restarter svc:/network/inetd:default is not running.
    See: http://sun.com/msg/SMF-8000-5H
    See: in.telnetd(1M)
    See: telnetd(1M)
    Impact: This service is not running.
    # svcs -x inetd
    svc:/network/inetd:default (inetd)
    State: offline since Tue Oct 09 13:36:58 2007
    Reason: Service svc:/network/dns/client:default has missing dependencies.
    See: http://sun.com/msg/SMF-8000-GE
    See: inetd(1M)
    Impact: 2 dependent services are not running. (Use -v for list.)
    Oct 5 21:36:04 Executing start method ("/lib/svc/method/fs-local") ]
    [ Oct  5 21:36:04 Method "start" exited with status 0 ]
    [ Oct  9 11:20:24 Executing start method ("/lib/svc/method/fs-local") ]
    [ Oct  9 11:20:25 Method "start" exited with status 0 ]
    [ Oct  9 11:31:15 Executing start method ("/lib/svc/method/fs-local") ]
    [ Oct  9 11:31:16 Method "start" exited with status 0 ]
    [ Oct  9 13:37:05 Executing start method ("/lib/svc/method/fs-local") ]
    [ Oct  9 13:37:06 Method "start" exited with status 0 ]
    # svcs -vx
    svc:/network/dns/client:default (DNS resolver)
    conf.
    #ident "@(#)login.dfl 1.
    State: offline since Tue Oct 09 13:36:57 2007
    svc:/network/nfs/client:default
    svc:/system/filesystem/autofs:default
    svc:/system/dumpadm:default
    svc:/system/fmd:default
    svc:/system/system-log:default
    svc:/milestone/multi-user:default
    svc:/milestone/multi-user-server:default
    svc:/network/inetd:default
    svc:/system/cron:default
    svc:/network/rpc/gss:default (Generic Security Service)
    State: uninitialized since Tue Oct 09 13:36:58 2007
    Reason: Restarter svc:/network/inetd:default is not running.
    See: http://sun.com/msg/SMF-8000-5H
    See: man -M /usr/share/man -s 1M gssd
    Impact: 7 dependent services are not running:
    svc:/network/nfs/client:default
    svc:/system/filesystem/autofs:default
    svc:/system/dumpadm:default
    svc:/system/fmd:default
    svc:/system/system-log:default
    svc:/milestone/multi-user:default
    svc:/milestone/multi-user-server:default
    #

  • FTP/telnet issue on OL 5 64bit

    I am trying to enable FTP/Telnet on Oracle Linux server (64bit), i am still getting same error.
    I installed required RPM's
    [root@apps xinetd.d]# rpm -qa|grep telnet
    telnet-0.17-38.el5
    [root@apps xinetd.d]# rpm -qa|grep ftp
    lftp-3.5.1-2.fc6
    tftp-0.42-3.1
    ftp-0.17-33.fc6
    [root@apps xinetd.d]# chkconfig telnet on
    error reading information on service telnet: No such file or directory
    [root@apps xinetd.d]#

    FTP and Telnet are really obsolete and considered a security risk. Both were replaced by the SSH2 package many years ago. Btw, you should use YUM and not install some very old Fedora software using RPM under Enterprise Linux, which can break your system beyond repair.
    If you really need a FTP server, simply do the following without the need to install any additional software.
    cd /etc/xinetd.d/ 
    vi gssftp
    Change the following:
    disable = yes to disable = no.
    remove the –a option in the server_args line.
    /etc/init.d/xinetd restart
    You should now be able to FTP to your server.What was the outcome of your previous post here?
    how to reassign disk space from root on OL 5
    Although feedback is not mandatory, it increases your chance to continue to receive answers. Leaving posts orphaned without a conclusion, even if you abandon the thread, does not add value to the community and is considered bad etiquette.

  • FTP & TELNET  in Enterprise Linux

    hi,
    can anyone help me am new in linux world,how can i connect ( ftp & telnet) from
    my xp machine to Enterprise Linux, i got connection refused
    thanks

    First, you'd have to see if any ftp and telnet-server packages are installed:
    # rpm -qa | grep ftp
    and
    # rpm -qa | grep telnetIf telnet server is not installed, you'd have to install it, for example:
      # up2date --install telnet-serverIf there's no ftp server package installed, this will work:
       # up2date --install vsftpd Then you'll want to start the vsftpd service:
      # /sbin/service vsftpd startSergio

  • FTP Host & user names?

    I just bought Fetch because I need to download some photos via FTP from a remote server. The software needs to know my hostname and user name. I use Mobile Me. What should I enter as the hostname? Is the user name just my name or is it also in the form of a web address? I'm stuck! Thanks for any help.

    Firstly, you did not need to buy Fetch - if you had looked around on the internet you would have seen that you could get Cyberduck or Transmit and download them both for free - I would say that these are probably better than Fetch anyway. Don't pay for them unless you need to.
    Also, what remote server are you talking about? MobileMe is not a remote server and if you have MobileMe all you need to do is log into your account and go to your iDisk and you can retrieve any photos that you need from there by opening the file on your iDisk directly, you don't need Fetch to do this.
    If you are really talking about a remote server then the details you need to enter in Fetch are those server details to connect with it - which hosting company is it with? You need to contact the hosting company to get those details or talk to the person who owns the remote server and get those details from them.
    For MobileMe - your own account you don't need Fetch anyway, so you might just have wasted your money!

  • Ftp anonymous user upload permission

    Please assist in detail to assign upload/mkdir permissions to anonymous ftp user.
    Thanks & regards,
    Omendra

    The last time I did a security audit for another company I just copied anonymous ftp instructions from the man pages. Has this changed?
    alan

  • "orcladmin" access has been disabled & some FTP problems & user IDs

    Hi,
    I was working on a problem with OCS 10g (10.1.2) where we can only upload/ftp successfully file types (with extensions: BMP, JPG, WAV, MP3 & LOG). Txt, Doc and XLS files get an access denied error.
    So I try to logon to "http://myocsserver.com:7778/content/" as orcladmin to change any applicable settings to allow all file types to be uploaded to my library in Content Services. When orcladmin access gets an error message "Error
    Your access has been disabled. Contact your system administrator for more information."
    I've tried looking at the product documentations, OTN and even MetaLink. Unfortunately I couldn't find anything. Can anyone tell me how to get my orcladmin account to work again on "http://myocsserver.com:7778/content/" ?
    When i goto "http://myocsserver.com:7777/oiddas/" and even "http://myocsserver.com:1810", orcladmin works just fine. When I examince orcladmin account in OID I see that it is not locked and is enabled. So I can't seem to understand/figure out why I get the error "Your access has been disabled. Contact your system administrator for more information."
    BTW, we also tried to create another super user account. We created it in OID granted it with all the privileges available and assigned it a domain admin role. However when it is able to logon to "http://myocsserver.com:7778/content/" it is not able to access the administration mode.
    Hopefully someone can point me in the right direction.
    Thanks in advance.
    Regards,
    -Ken

    Hi user544366,
    Thank you for the suggestion, I appreciate it.
    Hi all,
    Got a fix from Metalink support personnel on the orcladmin user access disabled issue. Apparrently you have to de-provision Content for orcladmin and re-provision again. After doing that we were able to login to Content services again ("Http://ourOCSserver:7778/content/").
    My remaining issue now is that even after I log on as orcladmin to Content Services I cannot find any settings that will fix my original problems. Using any user id (orcladmin etc) I can only successfully upload files w/ extensions (WAV, MP3, BMP, JPG & LOG) to Content services. I cannot upload -fails - (DOC, TXT, PDF, PPT & PDF) files to Content services. If I use FTP I get "Access Denied" error. If I use the web interface to upload I get an error "Error An Item must be selected etc."
    TIA.
    :)

  • FTP & Telnet using Tool

    I know that there have been some discussions running from time to time
    talking about integrating FTP and Telnet with Forte. Has anyone implemented
    either of these in Tool or has the trend been towards wrappering third party
    products? Some feedback would be terrific as we have the need to use both
    protocols and I would like to avoid some pitfalls up front.
    TIA
    Michael Strauss
    Mazda Australia
    Mazda Australia takes every precaution to ensure email messages are virus free. For complete protection, you should virus test this message.

    FTP and Telnet are really obsolete and considered a security risk. Both were replaced by the SSH2 package many years ago. Btw, you should use YUM and not install some very old Fedora software using RPM under Enterprise Linux, which can break your system beyond repair.
    If you really need a FTP server, simply do the following without the need to install any additional software.
    cd /etc/xinetd.d/ 
    vi gssftp
    Change the following:
    disable = yes to disable = no.
    remove the –a option in the server_args line.
    /etc/init.d/xinetd restart
    You should now be able to FTP to your server.What was the outcome of your previous post here?
    how to reassign disk space from root on OL 5
    Although feedback is not mandatory, it increases your chance to continue to receive answers. Leaving posts orphaned without a conclusion, even if you abandon the thread, does not add value to the community and is considered bad etiquette.

  • Ftp restricted user

    Hi,all:
    I have a similar question of restricting ftp users so that they could only be able to see a limited directories. How can I do that?
    Thanks for your reply.
    Rose

    Hi,
    Please refer to the infodoc published at the web site: http://sunsolve.sun.com
    The article no. is 16125 or use the link below to get to it
    http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=finfodoc%2F16125&zone_32=restricted%20ftp%20user
    Hope this helps

  • IIS Server / Ftp Isolation user not working in Windows 2008 R2

    HI,
    Please help as last time when we are still using the Server 2003 we don't have issue with the IIS virtual directory, what I mean is when the user log in there username and password they can only see directly their folder but when we already shift to server
    2008 everytime we log in we can able to see other users folder , of course even I try to open other users folder they cant able to access only what belongs to me.  I hope we can still do like last time, we can only see our own folder in file explorer.
    Please help..
    Thanks,

    Hi,
    As the permissions on IIS virtual directory are not similar with the permissions on windows file systems, I suggest you ask for help from IIS7 forum for better and accurate answer to the question.
    http://forums.iis.net
    Regards,
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to set SMB and FTP sharing for different users?

    In Tiger FTP and SMB sharing was different options with their own settings each other. In Leopard there if i enable user for sharing, it enables for all protocols together.
    Another problem. In file sharing i can add shared folder, but what's sens of it, if the whole filesystem is shared (at least FTP and AFP, not SMB, thanks god) and there's no way to remove this share. Just shortcut? How can i create ftp sharing, allowing user to see only his folder, not the whole filesystem?
    Any advices are pleased, except to get Leopard Server Thank you.

    OS X Client FTP implementation is not comprehensive at all. Apple does not make FTP serving a priority for OS X (on the general principle that it is not really necessary for most consumers). Thus, by default you can't enable/disable FTP for individual users. Nor can you create FTP only users.
    However, a useful product called [Pure-FTPd|http://www.pureftpd.org/project/pure-ftpd], provides the missing functionality for free to all UNIX based systems. Even better, [PureFTPd Manager|http://jeanmatthieu.free.fr/pureftpd> provides a GUI on OS X for managing it.
    This product is probably overkill for a single-user situation - but it is a great example of leveraging the UNIX platform of OS X to significantly enhance file sharing capabilities to server level.
    Cheers,
    Rodney

  • Question: FTP jobs local user field

    Just wanted to get an idea if anyone knows if as a best practice this should be populated or not.  We don't have the configuration setting 'FTP Local User Mandatory' checked, but I wonder if it should.  I am assuming that if local user is not populated that the agent service account then is what the job runs as.                  

    Everyones security requirements may vary. 
    I would suggest making it mandatory as a best practice as it forces you to be consistent. Then when that one-off happens and you need to deliver to a "secure" location the RTU id is obvious and not hidden by falling out to the agent service and a different RTU could be used that is permissioned. (we name our RTU and logon accounts for services differently)
    We have very few FTP jobs left in Tidal (we have to host our own FTP Solution anyway so we just use its API to send / rec) which will all be retired when we move to 6.X

  • RE: (forte-users) Forte SMTP and POP3 Support

    Scaffolds includes in a protocol library an smtphandler which allows us to
    send emails. It works great! You can try contacting someone at Metamor to
    see if they can give you more information on this. I can't give you any
    code as it is part of their package. Sorry!
    -----Original Message-----
    From: Rottier, Pascal [mailto:Rottier.Pascalpmintl.ch]
    Sent: Wednesday, February 23, 2000 7:22 AM
    To: 'edwardsmjwillis.com'; kamranaminyahoo.com
    Subject: RE: (forte-users) Forte SMTP and POP3
    Support
    Mark,
    Unfortunately, Forte doesn't offer any ready-to-use internet
    protocoll
    support libraries (like FTP, Telnet, SMTP, POP3, NNTP,
    UU-code
    or MIME). I think this would be a valuable enhancement of
    Forte.
    Does any one know if SUN plans to include this into Forte?
    Does
    any one know if there is any third-party set of Tool-classes
    that
    supports this?
    Pascal
    > -----Original Message-----
    > From: edwardsmjwillis.com [SMTP:edwardsmjwillis.com]
    > Sent: Wednesday, February 23, 2000 3:36 PM
    > To: kamranaminyahoo.com
    > Subject: (forte-users) Forte SMTP and POP3 Support
    >
    >
    >
    > Hi,
    >
    > Our Forte development team are currently investigating how
    we can add
    > internet
    > mail capabilities to a Forte application. Our application
    needs to
    > send/receive
    > mails from a mail server in an NT environment. Does forte
    provide SMTP and
    > POP3
    > protocol support (libraries) so that we can use external
    connection class
    > to
    > connect to the server and send/ receive mails or do we
    have to use third
    > party
    > controls ?.
    >
    > Any help regarding code examples or third party solutions
    would be
    > appreciated.
    >
    > Thanks in advance
    >
    > Mark J Edwards
    > Senior Technical Specialist
    > Willis
    >
    > Email: edwardsmjwillis.com
    >
    >
    >
    >
    >
    > The information in this email and in any attachments is
    confidential and
    > may be
    > privileged. If you are not the intended recipient, please
    destroy this
    > message,
    > delete any copies held on your systems and notify the
    sender immediately.
    > You
    > should not retain, copy or use this email for any purpose,
    nor disclose
    > all or
    > any part of its content to any other person.
    >
    >
    > --
    > For the archives, go to:
    http://lists.xpedior.com/forte-users and use
    > the login: forte and the password: archive. To
    unsubscribe, send in a new
    > email the word: 'Unsubscribe' to:
    forte-users-requestlists.xpedior.com
    For the archives, go to:
    http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe,
    send in a new
    email the word: 'Unsubscribe' to:
    forte-users-requestlists.xpedior.com

    Hi,
    Unfortunatly, Forte does not provide SMTP and POP3 protocoles.
    But, you can use External connections to do it if you need.
    You can find a simple SMTP send mail sample code on
    http://perso.club-internet.fr/dnguyen/ . The receive should be as easy as the send.
    For MIME base 64 encoding and decoding, it should last one or two weeks of coding
    (if you need optimization).
    One advantage of coding this in Tool directly is the portability.
    In your case, on NT, you could also interface with MAPI using for instance the
    ActiveX interface.
    By that way, you will already have SMTP, POP3 and MIME.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    http://perso.club-internet.fr/dnguyen/
    edwardsmjwillis.com a &eacute;crit:
    Hi,
    Our Forte development team are currently investigating how we can add internet
    mail capabilities to a Forte application. Our application needs to send/receive
    mails from a mail server in an NT environment. Does forte provide SMTP and POP3
    protocol support (libraries) so that we can use external connection class to
    connect to the server and send/ receive mails or do we have to use third party
    controls ?.
    Any help regarding code examples or third party solutions would be appreciated.
    Thanks in advance
    Mark J Edwards
    Senior Technical Specialist
    Willis
    Email: edwardsmjwillis.com
    The information in this email and in any attachments is confidential and may be
    privileged. If you are not the intended recipient, please destroy this message,
    delete any copies held on your systems and notify the sender immediately. You
    should not retain, copy or use this email for any purpose, nor disclose all or
    any part of its content to any other person.
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • FTP to SFTP.

    Hi,
    My application is using ftp to connect to the server. but now it is going to change to sftp. For that I am not able to get what are the things in need to change in my ftp program to make it support for sftp. The following is the ftpbean class and the methods of the class are used by other classes. sftp is already installed and the environment is ready now. but I am not able to proceed where to modify the java..Please help.
    import java.beans.PropertyChangeListener;
    import java.beans.PropertyChangeSupport;
    import java.io.*;
    import java.net.Socket;
    import java.net.ServerSocket;
    import java.util.StringTokenizer;
    import java.util.Vector;
    public class FtpBean
    private String server = ""; // server name
    private String user = ""; // user name
    private String replyMessage = ""; // reply message from server
    private String reply = ""; // reply to the command
    private Socket socket; // Socket for FTP connection
    private BufferedReader in; // Input for FTP connection
    private PrintWriter out; // Output for FTP connection
    private int port = 21; // FTP port number, default 21
    private boolean passive = true; // Passive mode transfer, default true
    // Needed for thread safety
    private int[] lock = new int[0]; // For synchronized locking
    private boolean acquired = false; // Count the number of acquire
    private Vector threadSpool = new Vector(); // Spool for the waiting threads
    // Needed for some Visual tools
    private PropertyChangeSupport pcs; // PropertyChangeSupport for visual tools
    final private boolean DEBUG = false; // True to turn on debug mode
    * Constructor
    public FtpBean()
    pcs = new PropertyChangeSupport(this);
    * Add PropertyChangeListener
    public void addPropertyChangeListener(PropertyChangeListener listener)
    pcs.addPropertyChangeListener(listener);
    * removePropertyChangeListener
    public void removePropertyChangeListener(PropertyChangeListener listener)
    pcs.removePropertyChangeListener(listener);
    * Connect to FTP server and login.
    * @param server Name of server
    * @param user User name for login
    * @param password Password for login
    * @exception FtpException if a ftp error occur (eg. Login fail in this case).
    * @exception IOException if an I/O error occur
    public void ftpConnect(String server, String user, String password)
    throws IOException, FtpException
    if (DEBUG) // Debug message
    System.out.println("FtpBean: Connecting to server " + server);
    acquire(); // Acquire the object
    // Set server name & user name
    setServerName(server);
    setUserName(user);
    try {
    // Create socket, get input & output stream
    socket = new Socket(server, port);
    in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    out = new PrintWriter(socket.getOutputStream(), true);
    // Read reply code when get connected
    getRespond();
    if (DEBUG) // Debug message
    System.out.println("FtpBean: Connected");
    // Login
    ftpLogin(user, password); // check if login success
    finally {
    release(); // Release the object
    * Close FTP connection.
    * @exception IOException if an I/O error occur
    * @exception FtpException if a ftp error occur
    public void close()
    throws IOException, FtpException
    if (out == null)
    return;
    acquire(); // Acquire the object
    try {
    ftpCommand("QUIT");
    if (!reply.startsWith("221"))
    throw new FtpException(reply);
    closeSocket();
    // Set server name & user name to ""
    setServerName("");
    setUserName("");
    finally {
    release(); // Release the object
    * Delete a file at the FTP server.
    * @param filename Name of the file to be deleted.
    * @exception FtpException if a ftp error occur. (eg. no such file in this case)
    * @exception IOException if an I/O error occur.
    public void fileDelete(String fileName)
    throws IOException, FtpException
    acquire(); // Acquire the object
    try {
    ftpCommand("DELE " + fileName);
    if (!reply.startsWith("250"))
    throw new FtpException(reply);
    finally {
    release(); // Release the object
    * Rename a file at the FTP server.
    * @param oldFileName The name of the file to be renamed
    * @param newFileName The new name of the file
    * @exception FtpException if a ftp error occur. (eg. A file named the new file name already in this case.)
    * @exception IOException if an I/O error occur.
    public void fileRename(String oldFileName, String newFileName)
    throws IOException, FtpException
    acquire(); // Acquire this object
    try {
    ftpCommand("RNFR " + oldFileName);
    if (!reply.startsWith("350"))
    throw new FtpException(reply);
    ftpCommand("RNTO " + newFileName);
    if (!reply.startsWith("250"))
    throw new FtpException(reply);
    finally {
    release(); // Release the object
    private boolean isSameSystem()
    throws IOException, FtpException
    String sysType = getSystemType();
    return (sysType.toUpperCase().indexOf("WINDOWS") < 0);
    * @param ftpFile Name of file to be get from the ftp server, can be in full path.
    * @param localFile File name of local file
    * @exception FtpException if a ftp error occur. (eg. No such file in this case)
    * @exception IOException if an I/O error occur.
    * @see FtpObserver
    public void getAsciiFile(String ftpFile, String localFile)
    throws IOException, FtpException
    getAsciiFile(ftpFile, localFile, null);
    * @param ftpFile Name of file to be get from the ftp server, can be in full path.
    * @param localFile File name of local file
    * @param observer The FtpObserver which monitor this downloading progress
    * @exception FtpException if a ftp error occur. (eg. No such file in this case)
    * @exception IOException if an I/O error occur.
    * @see FtpObserver
    public void getAsciiFile(String ftpFile, String localFile, FtpObserver observer)
    throws IOException, FtpException
    if (isSameSystem()) {
    getBinaryFile(ftpFile, localFile, observer);
    return;
    acquire(); // Acquire the object
    setTransferType(true); // Set transfer type to ascii
    Socket sock = null;
    try {
    sock = getDataSocket("RETR " + ftpFile, 0);
    // Read bytes from server and write to file.
    BufferedReader din = new BufferedReader(new InputStreamReader(sock.getInputStream()));
    PrintWriter dout = new PrintWriter(new BufferedWriter(new FileWriter(localFile)));
    char[] cbuf = new char[2048];
    int n;
    while ((n = din.read(cbuf, 0, cbuf.length)) != -1) {
    if (skipLineSepFilter())
    dout.write(cbuf, 0, n);
    else {
    // filter DOS line-sep to UNIX line-sep
    String data = filterLineSep(cbuf, n);
    dout.write(data, 0, data.length());
    if (observer != null)
    observer.byteRead(n);
    String data = null;
    while ((data = din.readLine()) != null) {
    dout.println(data);
    if (observer != null)
    observer.byteRead(data.length() + 1);
    din.close();
    dout.close();
    sock.close();
    getRespond();
    if (!reply.startsWith("226"))
    throw new FtpException(reply); // transfer incomplete
    finally {
    release(); // Release the object
    public void putAsciiFile(String localFile, String remoteFile, FtpObserver observer)
    throws IOException, FtpException
    acquire(); // Acquire the object
    setTransferType(true);
    // if file is to be transferred to MF, without slash, exec quote site cmd
    if (!remoteFile.startsWith("/"))
    setQuoteSite();
    Socket sock = null;
    try {
    // Read bytes from local file and write to a server.
    BufferedReader din = new BufferedReader(new FileReader(localFile));
    sock = getDataSocket("STOR " + remoteFile, 0);
    PrintWriter dout = new PrintWriter(new BufferedWriter(new OutputStreamWriter(sock.getOutputStream())));
    String data = null;
    while ((data = din.readLine()) != null) {
    //dout.println(data);
    dout.write(data);
    dout.write("\r\n");
    if (observer != null)
    observer.byteWrite(data.length() + 1);
    din.close();
    dout.close();
    sock.close();
    getRespond();
    if (DEBUG) // Debug message
    System.out.println("FtpBean: Reply is " + reply);
    putAsciiFile()
    Changed manner of checking if transfer is complete by checking the
    string Transfer Complete in the reply.
    For UNIX: Reply is 226 Transfer complete.
    For MF: Reply is 250 Transfer completed successfully.
    //if (!reply.startsWith("226"))
    int m = 0;
    if ((m = reply.indexOf("Transfer complete")) < 0)
    throw new FtpException(reply); // transfer incomplete
    finally {
    release(); // Release the object
    * Read file from ftp server and write to a file in local hard disk.
    * This method is much faster than those method which return a byte array<br>
    * if the network is fast enough.<br>
    * <br>Remark:<br>
    * Cannot be used in unsigned applet.
    * @param ftpFile Name of file to be get from the ftp server, can be in full path.
    * @param localFile Name of local file to be write, can be in full path.
    * @exception FtpException if a ftp error occur. (eg. No such file in this case)
    * @exception IOException if an I/O error occur.
    public void getBinaryFile(String ftpFile, String localFile)
    throws IOException, FtpException
    getBinaryFile(ftpFile, localFile, 0, null);
    * Read file from ftp server and write to a file in local hard disk.
    * This method is much faster than those method which return a byte array<br>
    * if the network is fast enough.<br>
    * <br>Remark:<br>
    * Cannot be used in unsigned applet.
    * @param ftpFile Name of file to be get from the ftp server, can be in full path.
    * @param localFile Name of local file to be write, can be in full path.
    * @param restart Restarting point
    * @exception FtpException if a ftp error occur. (eg. No such file in this case)
    * @exception IOException if an I/O error occur.
    public void getBinaryFile(String ftpFile, String localFile, long restart)
    throws IOException, FtpException
    getBinaryFile(ftpFile, localFile, restart, null);
    * Read file from ftp server and write to a file in local hard disk.
    * This method is much faster than those method which return a byte array<br>
    * if the network is fast enough.<br>
    * <br>Remark:<br>
    * Cannot be used in unsigned applet.
    * @param ftpFile Name of file to be get from the ftp server, can be in full path.
    * @param localFile Name of local file to be write, can be in full path.
    * @param observer The FtpObserver which monitor this downloading progress
    * @exception FtpException if a ftp error occur. (eg. No such file in this case)
    * @exception IOException if an I/O error occur.
    * @see FtpObserver
    public void getBinaryFile(String ftpFile, String localFile, FtpObserver observer)
    throws IOException, FtpException
    getBinaryFile(ftpFile, localFile, 0, observer);
    * Read from a ftp file and restart at a specific point.
    * This method is much faster than those method which return a byte array<br>
    * if the network is fast enough.<br>
    * Remark:<br>
    * Cannot be used in unsigned applet.
    * @param ftpFile Name of file to be get from the ftp server, can be in full path.
    * @param localFile File name of local file
    * @param restart Restarting point, ignored if equal or less than zero.
    * @param observer The FtpObserver which monitor this downloading progress
    * @exception FtpException if a ftp error occur. (eg. No such file in this case)
    * @exception IOException if an I/O error occur.
    * @see FtpObserver
    public void getBinaryFile(String ftpFile, String localFile, long restart, FtpObserver observer)
    throws IOException, FtpException
    acquire(); // Acquire the object
    setTransferType(false); // Set transfer type to binary
    Socket sock = null;
    try {
    sock = getDataSocket("RETR " + ftpFile, restart);
    // Read bytes from server and write to file.
    BufferedInputStream din = new BufferedInputStream(sock.getInputStream());
    RandomAccessFile dout = new RandomAccessFile(localFile, "rw");
    dout.seek(restart);
    byte[] data = new byte[1024];
    int n;
    while ((n = din.read(data)) != -1) {
    dout.write(data, 0, n);
    if (observer != null)
    observer.byteRead(n);
    din.close();
    dout.close();
    sock.close();
    getRespond();
    if (!reply.startsWith("226"))
    throw new FtpException(reply); // transfer incomplete
    finally {
    release(); // Release the object
    * Read a file from local hard disk and write to the server.
    * <br>Remark:<br>
    * <br>Cannot be used in unsigned applet.
    * @param local_file Name of local file, can be in full path.
    * @param remoteFile Name of file in the ftp server, can be in full path.
    * @exception FtpException if a ftp error occur. (eg. permission denied)
    * @exception IOException if an I/O error occur.
    public void putBinaryFile(String localFile, String remoteFile)
    throws IOException, FtpException
    putBinaryFile(localFile, remoteFile, 0, null);
    * Read a file from local hard disk and write to the server.
    * <br>Remark:<br>
    * <br>Cannot be used in unsigned applet.
    * @param localFile Name of local file, can be in full path.
    * @param remoteFile Name of file in the ftp server, can be in full path.
    * @param observer The FtpObserver which monitor this uploading progress.
    * @exception FtpException if a ftp error occur. (eg. permission denied)
    * @exception IOException if an I/O error occur.
    public void putBinaryFile(String localFile, String remoteFile, FtpObserver observer)
    throws IOException, FtpException
    putBinaryFile(localFile, remoteFile, 0, observer);
    * Read a file from local hard disk and write to the server with restarting point.
    * Remark:<br>
    * Cannot be used in unsigned applet.
    * @param localFile Name of local file, can be in full path.
    * @param remoteFile Name of file in the ftp server, can be in full path.
    * @param restart The restarting point, ignored if less than or greater than zero.
    * @exception FtpException if a ftp error occur. (eg. permission denied)
    * @exception IOException if an I/O error occur.
    public void putBinaryFile(String localFile, String remoteFile, long restart)
    throws IOException, FtpException
    putBinaryFile(localFile, remoteFile, restart, null);
    * Read a file from local hard disk and write to the server with restarting point.
    * Remark:<br>
    * Cannot be used in unsigned applet.
    * @param localFile Name of local file, can be in full path.
    * @param remoteFile Name of file in the ftp server, can be in full path.
    * @param observer The FtpObserver which monitor this uploading progress
    * @exception FtpException if a ftp error occur. (eg. permission denied)
    * @exception IOException if an I/O error occur.
    public void putBinaryFile(String localFile, String remoteFile, long restart, FtpObserver observer)
    throws IOException, FtpException
    acquire(); // Acquire the object
    setTransferType(false);
    Socket sock = null;
    try {
    RandomAccessFile din = new RandomAccessFile(localFile, "r");
    sock = getDataSocket("STOR " + remoteFile, restart);
    if (restart > 0)
    din.seek(restart);
    DataOutputStream dout = new DataOutputStream(sock.getOutputStream());
    byte[] data = new byte[1024];
    int n;
    while ((n = din.read(data)) != -1) {
    dout.write(data, 0, n);
    if (observer != null)
    observer.byteWrite(n);
    din.close();
    dout.close();
    sock.close();
    getRespond();
    putBinaryFile()
    Changed manner of checking if transfer is complete by checking the
    string Transfer Complete in the reply.
    For UNIX: Reply is 226 Transfer complete.
    For MF: Reply is 250 Transfer completed successfully.
    //if (!reply.startsWith("226"))
    int m = 0;
    if ((m = reply.indexOf("Transfer complete")) < 0)
    throw new FtpException(reply); // transfer incomplete
    finally {
    release(); // Release the object
    * Get current directory name.
    * @return The name of the current directory.
    * @exception FtpException if a ftp error occur.
    * @exception IOException if an I/O error occur.
    public String getDirectory()
    throws IOException, FtpException
    acquire(); // Acquire the object
    try {
    ftpCommand("PWD");
    if (!reply.startsWith("257"))
    throw new FtpException(reply);
    int first = reply.indexOf("\"");
    int last = reply.lastIndexOf("\"");
    return reply.substring(first + 1, last);
    finally {
    release(); // Release the object
    * Change directory.
    * @param directory Name of directory
    * @exception FtpException if a ftp error occur. (eg. permission denied in this case)
    * @exception IOException if an I/O error occur.
    public void setDirectory(String directory)
    throws IOException, FtpException
    acquire(); // Acquire the object
    try {
    ftpCommand("CWD " + directory);
    if (!reply.startsWith("250"))
    throw new FtpException(reply);
    finally {
    release(); // Release the object
    * Change to parent directory.
    * @exception FtpException if a ftp error occur. (eg. permission denied in this case)
    * @exception IOException if an I/O error occur.
    public void toParentDirectory()
    throws IOException, FtpException
    acquire(); // Acquire the object
    try {
    ftpCommand("CDUP");
    if (!reply.startsWith("250"))
    throw new FtpException(reply);
    finally {
    release(); // Release the object
    * Get the content of current directory
    * @return A FtpListResult object, return null if it is not connected.
    * @exception FtpException if a ftp error occur. (eg. permission denied in this case)
    * @exception IOException if an I/O error occur.
    * @see FtpListResult
    public FtpListResult getDirectoryContent()
    throws IOException, FtpException
    String strList = getDirectoryContentAsString();
    FtpListResult ftpList = new FtpListResult();
    ftpList.parseList(strList, getSystemType());
    return ftpList;
    * Get the content of current directory.
    * @return A list of directories, files and links in the current directory.
    * @exception FtpException if a ftp error occur. (eg. permission denied in this case)
    * @exception IOException if an I/O error occur.
    public String getDirectoryContentAsString()
    throws IOException, FtpException
    StringBuffer list = new StringBuffer(""); // Directory list
    Socket sock = null; // Socket to establish data connection
    acquire(); // Acquire the object
    try {
    // get DataSocket for the LIST command.
    // As no restarting point, send 0.
    sock = getDataSocket("LIST", 0);
    BufferedReader din = new BufferedReader(new InputStreamReader(sock.getInputStream()));
    // Read bytes from server.
    String line;
    while ((line = din.readLine()) != null)
    list.append(line).append("\n");
    din.close();
    sock.close();
    getRespond();
    if (!reply.startsWith("226"))
    throw new FtpException(reply);
    finally {
    release(); // Release the object
    return list.toString();
    * Make a directory in the server.
    * @param directory The name of directory to be made.
    * @exception FtpException if a ftp error occur. (eg. permission denied in this case)
    * @exception IOException if an I/O error occur.
    public void makeDirectory(String directory)
    throws IOException, FtpException
    acquire(); // Acquire the object
    try {
    ftpCommand("MKD " + directory);
    if (!reply.startsWith("257"))
    throw new FtpException(reply);
    finally {
    release(); // Release the object
    * Remove a directory in the server
    * @param directory The name of directory to be removed
    * @exception FtpException if a ftp error occur. (eg. permission denied in this case)
    * @exception IOException if an I/O error occur.
    public void removeDirectory(String directory)
    throws IOException, FtpException
    acquire(); // Acquire the object
    try {
    ftpCommand("RMD " + directory);
    if (!reply.startsWith("250"))
    throw new FtpException(reply);
    finally {
    release(); // Release the object
    * Execute a command using ftp.
    * e.g. chmod 700 file
    * @param exec The command to execute.
    * @exception FtpException if a ftp error occur. (eg. command not understood)
    * @exception IOException if an I/O error occur.
    public void execute(String exec)
    throws IOException, FtpException
    acquire(); // Acquire the object
    try {
    ftpCommand("SITE " + exec);
    if (!reply.startsWith("200"))
    throw new FtpException(reply);
    finally {
    release(); // Release the object
    private String _ftpSystemType = null;
    * Get the type of operating system of the server.
    * Return null if it is not currently connected to any ftp server.
    * @return Name of the operating system.
    public String getSystemType()
    throws IOException, FtpException
    if (_ftpSystemType != null)
    return _ftpSystemType;
    acquire(); // Acquire the object
    try {
    ftpCommand("SYST");
    if (!reply.startsWith("215"))
    throw new FtpException(reply);
    _ftpSystemType = reply.substring(4);
    return _ftpSystemType;
    finally {
    release(); // Release the object
    * Return the port number
    public int getPort()
    return port;
    * Set port number if the port number of ftp is not 21
    public void setPort(int port)
    acquire(); // Acquire the object
    pcs.firePropertyChange("port", new Integer(this.port), new Integer(port));
    this.port = port;
    release(); // Release the object
    * Return the server name. Return "" if it is not connected to any server.
    public String getServerName()
    return server;
    * Return the user name. Return "" if it is not connected to any server.
    public String getUserName()
    return user;
    * Get reply of the last command.
    * @return Reply of the last comomand<br>for example: 250 CWD command successful
    public String getReply()
    return reply;
    * Get reply message of the last command.
    * @return Reply message of the last command<br>for example:<br>
    * 250-Please read the file README<br>
    * 250-it was last modified on Wed Feb 10 21:51:00 1999 - 268 days ago
    public String getReplyMessage()
    return replyMessage;
    * Return true if it is using passive transfer mode.
    public boolean isPassiveModeTransfer()
    return passive;
    * Set passive transfer mode. Default is true.
    * @param passive Using passive transfer if true.
    public void setPassiveModeTransfer(boolean passive)
    acquire(); // Acquire the object
    pcs.firePropertyChange("passiveModeTransfer", new Boolean(this.passive), new Boolean(passive));
    this.passive = passive;
    if (DEBUG) // debug message
    System.out.println("FtpBean: Set passive transfer - " + passive);
    release(); // Release the object
    * Close the Socket, input and output stream
    private void closeSocket()
    throws IOException
    _ftpSystemType = null;
    in.close();
    out.close();
    socket.close();
    in = null;
    out = null;
    socket = null;
    * Read the respond message from the server's inputstream and assign to replyMessage
    private void getRespond()
    throws IOException
    String line = "";
    String replyMessage = "";
    while (true) {
    // Problem.....
    line = in.readLine();
    if (!checkReply(line))
    break;
    replyMessage = replyMessage.concat(line).concat("\n");
    setReplyMessage(replyMessage);
    setReply(line);
    * Login to server, using FTP commands "USER" and "PASS"
    * @param user FTP username
    * @param password FTP Password
    private void ftpLogin(String user, String password)
    throws IOException, FtpException
    ftpCommand("USER " + user); // send user name
    ftpCommand("PASS " + password); // send password
    if (!reply.startsWith("230")) {
    closeSocket();
    throw new FtpException(reply);
    * Send FTP command to the server.
    * @param command The command to be sent
    private void ftpCommand(String command)
    throws IOException
    if (DEBUG) {  // Debug message
    if (command.startsWith("PASS"))
    System.out.println("FtpBean: Send password");
    else
    System.out.println("FtpBean: Send command \"" + command + "\"");
    out.print(command + "\r\n"); // Send command
    out.flush();
    getRespond();
    * Establish data connection for transfer
    private Socket getDataSocket(String command, long restart)
    throws IOException, FtpException
    Socket sock = null;
    ServerSocket ssock = null;
    // Establish data conncetion using passive or active mode.
    if (passive)
    sock = getPassiveDataSocket();
    else
    ssock = getActiveDataSocket();
    // Send the restart command if it is greater than zero
    if (restart > 0) {
    ftpCommand("REST " + restart);
    if (!reply.startsWith("350"))
    throw new FtpException(reply);
    // Send commands like LIST, RETR and STOR
    // These commands will return 125 or 150 when success.
    ftpCommand(command);
    if (!(reply.startsWith("125") || reply.startsWith("150")))
    throw new FtpException(reply); // command file
    // Get Socket object for active mode.
    if (!passive)
    sock = ssock.accept();
    return sock;
    * Establish data connection in passive mode using "PASV" command
    * Change the server to passive mode.
    * by the command "PASV", it will return its address
    * and port number that it will listen to.
    * Create a Socket object to that address and port number.
    * Then return the Socket object.
    private Socket getPassiveDataSocket()
    throws IOException, FtpException
    ftpCommand("PASV");
    if (!reply.startsWith("227"))
    throw new FtpException(reply);
    // array that holds the outputed address and port number.
    String[] address = new String[6];
    // put the 'reply' to the array 'address'
    StringTokenizer t = new StringTokenizer(reply, ",");
    for (int i = 0; i < 6; i++)
    address[i] = t.nextToken();
    // Get port number.
    // Erase all other characters except the port number
    // which is at the beginning of the string
    String lastPort = "";
    int num = 3;
    if (address[5].length() < 3)
    num = address[5].length();
    for (int i = 0; i < num; i++) {
    if (Character.isDigit(address[5].charAt(i)))
    lastPort = lastPort + address[5].charAt(i);
    // assign last port number to address[5]
    address[5] = lastPort;
    // Get the port number
    // Left shift the first number by 8
    int newPort = (Integer.parseInt(address[4]) << 8) + Integer.parseInt(address[5]);
    // Create a new socket object
    Socket sock = new Socket(getServerName(), newPort);
    return sock;
    * Establish data connection in active mode using "PORT" command.
    * It create a ServerSocket object to listen for a port number in local machine.
    * Use port command to tell the server which port the local machine is listenning.
    * Return the ServerSocket object.
    private ServerSocket getActiveDataSocket()
    throws IOException, FtpException
    int[] portNumbers = new int[6]; // Array that contains
    // Get ip address of local machine. ip address and port numbers
    String localAddr = socket.getLocalAddress().getHostAddress();
    // Assign the ip address of local machine to the array.
    StringTokenizer st = new StringTokenizer(localAddr, ".");
    for (int i = 0; i < 4; i++)
    portNumbers[i] = Integer.parseInt(st.nextToken());
    ServerSocket ssocket = new ServerSocket(0); // ServerSocket to listen to a random free port number
    int localPort = ssocket.getLocalPort(); // The port number it is listenning to
    // Assign port numbers the array
    portNumbers[4] = ((localPort & 0xff00) >> 8);
    portNumbers[5] = (localPort & 0x00ff);
    // Send "PORT" command to s

    You would have to pick a library to do that. There are several commercial libraries. Out of the open source ones, the most mature one seems to be Ganymed SSH-2.

  • Slow Authentication on FTP

    I have an OS-10.5.1 Server that I am presently using for nothing other than an FTP server. (users are set up with OD passwords in LDAPv3 local.) Updates have been held back to 10.5.1
    Authentication is very slow, about 15-20 seconds.
    I've done some research on this and tend to think it is attempting RFC 931 authentication. I would like to turn this off but only find ways to turn this off for xinetd or xftpd. These were on earlier servers but the Leopard server uses ftpd.
    I don't see /etc/ftpd.conf file so I'm wondering where and how I should change this setting. If someone thinks my problem is elsewhere, I would welcome those comments too.
    Any help would be greatly appreciated.

    O.K., is this an initial login slowness issue only or is it slow for every action?
    If it is only for login then this sounds like it is more a DNS issue than a confgiratoin issue.
    Check to see if you can resolve the clients address from the Server with something like _nslookup ipaddress_.
    Peter

Maybe you are looking for

  • Editable field in alv list display

    i WANT TO GIVE COLOR FOR EDITABLE FIELD IN ALV LIST DISPLAY.i TRIED WITH EMPHASIZE IN FIELD CATALOGUE ASSIGNING.bUT,IT IS NOT WORKING.HOW TO DO.tHANX IN ADVANCE.........

  • Problem in Tax determination

    Hi, basic price = 100 discount  =     20 Net          =     80 freight      =     10 Total        =     90 For state 1 Tax need to calculate on Total value of 90 should include Freight. For state 2 Tax need to calculate on  net value of 80 should exc

  • Fast method to fill Table with ring controls from index

    Dear Users, I have a rather big table that contains one row with ring control cells. Teh table is filled from a few arrays before usage and the user is supposed change the value of certain cells by selecting the ring items.  I have 2 questions: 1.) i

  • CS5 fails to compile large FLAs

    There was this problem with CS4 which was solved with an upgrade and now CS5 again fails to compile my larger FLAs. Sad to see the IDE going backwards.

  • Other language

    I am trying to translate my site to russian, but the server ( not .mac) doesn't see other characters, specially if I have page names in russian. Anybody with similar problem?