date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,501,174,611,000 |
In the curl command we can delete,rename and move files from a FTP server using Curl like in the command below:
curl -v -u username:pwd ftp://host/FileTodelete -Q "DELE FileTodelete"
Can we untar or unzip files like this way ? I mean that instead of DELE FileTodelete we put a untar/unzip command to extract a file in ... |
No, in general this isn't possible.
A FTP server usually has commands to get information about files and directories and to store, retrieve, delete and rename files. Commands to mount devices and to send messages to users are also standardized but not implemented in current servers. See the list of FTP commands on Wik... | unzip/untar files using Curl in ftp server |
1,501,174,611,000 |
RFC 1123 says
Implementors MUST NOT assume any correspondence between READ
boundaries on the control connection and the Telnet EOL
sequences (CR LF).
DISCUSSION:
Thus, a server-FTP (or User-FTP) must continue reading
characters from the control connection until a complete
Telnet EOL sequence is encountere... |
Telnet has two basic modes of operation: line mode and character mode. The default mode is always line mode. The telnet application then has to negotiate with the remote server about what it can and cannot support. This is done through a system called TELOPT and the special character 255 known as IAC - Interpret As Co... | Why does `telnet` buffer FTP control connection lines? |
1,501,174,611,000 |
I am setting up my Ubuntu 14.04 server.
I want to have an FTP access (I use vsftpd), mainly for my apache2 server, so I added a new user to the www-data group. I also set up the settings for vsftpd.conf, only allowing local users, and chroot_local_user=YES.
I changed the home directory of my new user to /var/www/hom... |
This is not how I would do this, but answering your question anyway:
From man vsftpd.conf:
chroot_list_enable
If activated, you may provide a list of local users who are
placed in a chroot() jail in their home directory upon login.
The meaning is slightly different if chroot_local_user is set... | ftp user for root directories? [closed] |
1,501,174,611,000 |
I want to change my ProFTPD server port from 21 to 1945. But I didn't find any port mention in the proftpd.conf file. When I add port 21 in the conf file and restart the ftp server it shows the following error:
Starting proftpd (via systemctl): Job failed. See system logs and 'systemctl status' for details.
[FAILED]... |
You can use Port directive:
Port <port number>
A note that if you set port to N, then you must let port N-1 available too. RFC959 defined that source port for active data transfer must be N-1.
You can use Port directive both in server context or virtual server context. Setting Port 0 disable server.
| How to change the ftp server port in ProFTPD |
1,501,174,611,000 |
So using vsftpd I want to lock a user to /home/theirname/Minecraft. I can't change their home directory because a program I'm using(McMyAdmin) will try to reinstall itself but I don't want them having access to the programs configs.
|
This tutorial would seem to be what you're looking for, titled: Setup Virtual Users and Directories in VSFTPD.
excerpt
In /etc/vsftpd.conf.
listen=YES
anonymous_enable=NO
local_enable=YES
virtual_use_local_privs=YES
write_enable=YES
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd
pam_service_name=vsftpd
gue... | vsftpd limit users to /home/user/minecraft |
1,501,174,611,000 |
I was not able to ftp to my remote server. I read Ubuntu doc to see how to resolve:
https://help.ubuntu.com/10.04/serverguide/ftp-server.html
Just now I installed vsftpd on my remote machine. Now when I run
ftp rs
it's saying :
ravbholua@ravbholua-Aspire-5315:~$ ftp rs
Connected to ravi.com.
220 (vsFTPd 3.0.2)
331 Pl... |
Not quite sure why vsftpd.conf is quoted as looking okay above... The question asks why anonymous FTP doesn't work, and the line "anonymous_enable=NO" is in the config file, so thats one point of note.
Since the FTP client didn't bother to prompt you for a password, I'd assume its "auto" logging in as anonymous - sinc... | Not able to ftp remote server anonymously |
1,501,174,611,000 |
I need to back up ~0.5 TB of files (about 600,000 of them) from a Windows Server 2003 machine to a CentOS 6.4 machine across a 100MB network, and update them once a night.
The backup script would be hosted on CentOS. Will SlimFTPd server+standard CentOS ftp client, or Windows AD fileshare+Samba 4 client be faster for... |
I would use rsync, because that only copies what has changed.
I would install cygwin with openssh and rsync on the windows server, and use rsync over ssh to make the backup, with a command such as this:
rsync -e ssh -var --progress --partial server:/cygdrive/c/myfiles $HOME/mybackup
The advantage over using either of... | rsync: samba vs ftp for backup |
1,501,174,611,000 |
I am running a CentOS VPS.
Now I have installed an FTP server on the Server like this:
yum install vsftpd
And I have restarted the service as well.
However, when I point my browser to:
ftp://myStaticIP
it does not return anything.
Also, how do I add an FTP user to my VPS so that I can log in via a client?
|
Normally on StackExchange sites, answers are supposed to be comprehensive and not merely link to other resources. However, you're asking two pretty basic, but very broad, questions here.
How do I configure the CentOS firewall?
How do I configure vsftpd on CentOS?
I can't write an answer which gives you everything y... | How to add FTP users to my CentOS VPS [closed] |
1,501,174,611,000 |
I know the ftp username, password, and directory of the source.
I just want to download the whole thing to a new server.
Simple download.
The username is not root. So I wonder how I would specify the directory name? Should I give the /home/username/public_html or should I give it as ~username/public_html
|
wget
Use wget as follow
wget --mirror --no-parent --user=<ftpuser> --password=<ftppassword> ftp://server/<directory path>
It will download the whole directory recursively.
Option --no-parent
Do not ever ascend to the parent directory when retrieving recursively. This is a useful option, since it guarantees that onl... | In FTP, can I specify a remote directory using `~username` syntax? |
1,501,174,611,000 |
I am connecting to my server via FTP (that is the only way I have access to this server in particular). I need to utime a command via FTP to the server. Other commands work but when I try something like
site for file in *;do utime 20120101084400 ${file}; done;
to change all dates in a given directory, I receive an er... |
Allowed SITE commands vary with the FTP daemon in use (like, SITE CHMOD in vsftpd; some more in Apache's FtpServer). In general, it's not the remote shell facility you seem to expect.
However, ProFTPd apparently supports SITE UTIME.
So if your FTPd in question has SITE UTIME, you could try to SITE UTIME in a client-... | Trying to Utime via FTP |
1,501,174,611,000 |
There is a script (bsh) running in a AIX 7.1 machine. The script is to download some files via FTP from another machine. I need to stop it later because some guy need to have maintenace over the machine, even if the script is not finished.
So I would like to know, if I re-run the script later, can I configure the ftp ... |
Short answer no.
FTP is a blunt tool. Use wget which does provide this functionality and can pull files from an FTP server.
An even better option is to use rsync (over ssh).
| ftp option to overwrite file if different size |
1,501,174,611,000 |
I tried to rsh a shell script from OpenVms to a Red Hat linux. It seems that it is not executed.
I created the shell script in OpenVms and Ftp it to the linux. I then ls -la the folder in linux:
-rw-r--r-- 1 buedev buedev 382 Jul 20 11:03 files.sh
It seems that even the owner don't have the right to exec... |
In order to execute, the execute bit must be set. Even the owner of a file cannot ask the system to execute it if it's not marked as executable.
The one caveat here is that in the case of most shell scripts, you can execute them by calling the shell yourself and feeding the script data to it as an argument.
/bin/sh /p... | Do we need to chmod a shell script before it can be rsh |
1,501,174,611,000 |
I'm working on a program that involves uploading some files via FTP. However, I'd like to abort the process if the username and password given by the user are incorrect.
Is there any way to "test" if the pair is correct? Is a utility like ftp or curl able to do that, or should I use some feature (apparently hidden at ... |
The short answer is - no you will need to try the FTP connection via libcurl and see if the authentication succeeds.
The username/password only exist on the remote server, and you don't know if they are being changed or altered at any stage (for legitimate reasons). Hence, your code will have to take credentials from... | Test FTP Username and Password |
1,501,174,611,000 |
I'm writing a perl program where I want to accept all kinds of "file names" from the user, including /home/foo/bar.txt and scp://server/some/file.txt or whatever. And then I thought that if I can find a cmd line program that does it, I'll find a perl module that does it too, or I'll just run it through perl's system()... |
I believe protocol name is sftp, not scp.
In my system, following works: lftp -c 'get sftp://someserver/file', as well as ftp and http.
| Need command-line program to download all of http:// https:// scp:// ftp:// style links (on e.g. ubuntu) |
1,603,959,433,000 |
I need to connect to a remote Linux server over SFTP and read the entire folder structure of the server. I would like to list all directories, even directories with no read permissions, and preferably without changing the permissions of the directories.
I would like to avoid using root, and I think that a good solutio... |
sftpsrv=/usr/libexec/openssh/sftp-server
cp -a ${sftpsrv} ${sftpsrv}.super
chmod 500 ${sftpsrv}.super
chown someuser ${sftpsrv}.super
/sbin/setcap cap_dac_read_search+ep ${sftpsrv}.super
You'll need to connect to your server this way:
sftp -s /usr/libexec/openssh/sftp-server.super address
And it works!
ls -la /tmp | ... | Creating a user with read permissions to all directories in a Linux server |
1,603,959,433,000 |
I was testing bache on raspberry pi 4 with ubuntu. The reason I choose ubuntu that I found standard raspbian got some issues with bcache as kernel module not properly loaded. I tried to troubleshoot bit but then I move to ubuntu and it works straight away
My setup is like this.
1 x 1TB HGST 5400RPM 2.5 laptop hard dis... |
I managed to solve this issue with the instructions of https://www.raspberrypi.org/forums/viewtopic.php?t=245931 this topic.
This is due to Raspberry PI 4 USB 3.0 UASP driver issue and it make my external SSD connection intermittent. After adding line to cmdline.txt for ignore the UAS interface my SSD is working flaw... | Testing bcache with raspberry pi 4 on ubuntu |
1,603,959,433,000 |
I have an Apache web server running on this machine with Debian stable, this PHP program have to connect using FTP to a remote online server among other things.
Everything worked fine until I installed an FTP server (vsftpd version 3.0.3-8+b1), but I don't think this is the culprit.
Now I get this error
The exact erro... |
Issue at Hand
You are reporting that you cannot connect to your remote ftp server. You receive the following error message:
I won't open a connection to x.x.x.x remote server ip (only to x.x.x.x my public ip)
Depending on if you are using a php ftp or vsftpd solution as your ftp server solution, I may have found 2 p... | ftp passive mode and php |
1,603,959,433,000 |
I have vsftpd running on Ubuntu 16.04 LTS.
During installation a ftp user is created with a home directory of /srv/ftp and hence this is the default FTP directory.
Here are my vsftpd.conf file permissions that I've set.
listen_ipv6=YES
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_umask=0... |
I have installed vsftpd, filezilla, went through your .conf and added options accordingly:
$ sudo cat /etc/vsftpd/vsftpd.conf | grep -v "#"
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_por... | Not able to upload as anonymous user in vsftpd |
1,603,959,433,000 |
So I'm trying to setup a ftp service and send some files through my C# application to it. I can upload files to the main folder /www/ just fine, but I can't figure out how to give permission to the user "kmsuser" group "ftpaccess" to upload files in the subdirectories in /www/. I tried the chgrp command and it looked ... |
The subfolders don't have group write permission (note the dash in the middle drwxr - xr-x). Use chmod g+w to add that to each of those (append folder name to the command just like with chgrp).
| FTP Permissions |
1,603,959,433,000 |
I have an issue with an API from an external provider. Their API should do an FTP push to an external server. However, it is failing. They say that the Append Function needs to be active/enabled as according to them - the push is failing because the file can't be created on the server (I realize that Append would just... |
Append works by default for a stock vsftpd install on Centos with an authenticated login.
$ sudo yum -y install vsftp ftp
...
$ mkdir ~/tmp; cd ~/tmp
$ echo hi > foo
$ ftp localhost
...
ftp> put foo
...
ftp> ^Z
$ cat ~/foo
hi
$ fg
append foo foo
...
ftp> ^Z
$ cat ~/foo
hi
hi
$
You'll need to debug the FTP connection ... | How to check if Append Function is activated/enabled on Linux server |
1,603,959,433,000 |
I must connect to ftp to get some files occasionally. To do this I made a script.
The problem is that the user is generic and all of my work uses this user in the local host, and the remote machine. I must connect it with my personal user so they can see my password in the script
There is some way to avoid these?
|
If the script is run only when you are logged in, you could set the password in an environment variable that is read when the script is run - set it once per session instead of hard-coding it or prompting for it. For example:
# log in to your session
[user@host] export pass=1234abc
[user@host] my-ftp.sh
Note the ext... | Hide password ftp with the same user |
1,603,959,433,000 |
I've installed Open Panel, which seems to ship with Pure FTP server. I added a linux user ftpuser, and now I can log in with it. I'd like to specify a directory to which this user starts with when it logs in.
How can I achieve this?
|
You can use a program like usermod with its -d option if you have that installed:
usermod -d /new/ftpuserhome ftpuser
if you don't have that, you can also edit the /etc/passwd file as root and change the 6th field (the one before the last field (: is the field separator).
| (Pure FTP) FTP User login directory |
1,603,959,433,000 |
I cannot seem to retrieve a non-zero return code when calling the ftp macro. It doesn't matter what errors are encountered during the ftp macro execution e.g. directory doesn't exist, file doesn't exists etc.
I'd love to know why.
I'm using bash on Solaris.
My .netrc file looks like so:
machine myftp1
login x... |
The 'ftp' command does not seem to return other error codes than 0.
An alternative solution would be to check the FTP return codes.
There is some examples in how to do this here: https://stackoverflow.com/a/4442763
| Return code is always 0 after running echo "\$ macroName " | ftp -i mymachine |
1,603,959,433,000 |
uploaded file via filezilla to proftp server(on ubuntu 14.04 lts) but reported 550 error
550 download.html: Permission denied
Error: Critical file transfer error
I try to set the directory to chmod 777
but error is same
ftp for download is OK
your comment welcome
|
Exactly the same thing happened to me after upgrading from Precise Pangolin to Trusty Tahr. I investigated and it looks like /etc/vsftpd.conf, the FTP configuration file, was one of the configuration files amended during the upgrade. Specifically, this line:
write_enable=YES
which I had previously uncommented was now... | uploaded file via filezilla to proftp server(on ubuntu 14.04 lts) but reported 550 error |
1,603,959,433,000 |
I'm trying to connect to an FTP site but with, e.g., wget:
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /gcrypt/gnutls ... done.
==> SIZE v3.2 ... done.
==> PASV ... couldn't connect to 217.69.76.55 port 40258: Network is unreachable
If I disable ipt... |
Iptables needs some kernel modules loaded in order for "RELATED, ESTABLISHED" to work. If your HTTP clients are okay, you obviously have some of them.
> lsmod | grep conntrack
nf_conntrack_ipv4 20258 6
nf_defrag_ipv4 12702 1 nf_conntrack_ipv4
xt_conntrack 12760 6
nf_conntrack ... | FTP download problems with iptables -- Port 21 connection is allowed but "Network is unreachable" |
1,603,959,433,000 |
I added the below 2 lines in the end of the configuration file /etc/vsftpd.conf so as to deny a local user named 'tentenths' from loggin in the ftp server. I restarted the vsftpd service after the change. But still the user was permitted to login. Where am I mistaken!
userlist_deny=YES
userlist_file=/etc/vsftpd.denied... |
You also need to add this configuration option:
userlist_enable=YES
Details
userlist_deny — When used in conjunction with the userlist_enable directive and set to NO, all local users are denied access unless the username is listed in the file specified by the userlist_file directive. Because access is denied before ... | Not able to deny selected local user to login ftp server |
1,603,959,433,000 |
I have a ftp server running on the machine 192.168.122.50
Below are the last three directives from /etc/vsftpd/vsftpd.conf file
pam_service_name=vsftpd
#userlist_enable=YES
#userlist_deny=YES
Below is the content of /etc/pam.d/vsftpd file
#%PAM-1.0
session optional pam_keyinit.so force revoke
auth req... |
IMO, it's a way how lftp client works. Check the log file /var/log/secure (on RHEL/CentOS) or similar for events like
pam_listfile(vsftpd:auth): Refused user root for service vsftpd
I verified such behavior by sniffing FTP traffic (RHEL 6.x, vsftpd 2.2.2, lftp 4.0.9). The FTP connection is not established till you e... | "lftp" login still possible for "/etc/pam.d/vsftpd" blocked users |
1,603,959,433,000 |
In case of TFTP, one can choose between "ASCII" or "octet" mode. As I have understood, 00001010(new-line) or 00001101(carriage return) bit streams in a binary file will get some sort of special treatment in ASCII mode? However, I created a file containing those characters:
root@A58:~# printf '\n' | xxd | xxd -r > bfil... |
TFTP uses similar mechanisms as telnet for transmitting ASCII. It follows the rules set out in the NVT specification. So effectively end-of-line markers are terminated with <cr><lf>, and if you want to send an actual <cr> then this is translated to <cr><nul>.
hexdumping a file I created:
00000000 0d 54 65 73 74 69 6e... | Carriage Return and Line Feed bit streams in a binary file during TFTP upload in ASCII mode |
1,603,959,433,000 |
I have two dedicated servers: one has CentOS, the other Ubuntu. I installed backup manager on both servers. But I have two different behaviors.
On CentOS:
The backup of my files is "every night". I wish "every week."
The backup of my DB is "every night" (that's good).
the action is executed twice each night (once at ... |
I just re-installed and everything works. This is clearer.
| Backup Manager and Cron : CentOs and Ubuntu 11.10 |
1,603,959,433,000 |
I'm using the squid proxy on CentOS but, I can't connect to FTP sites from WAN. I did open FTP ports in the firewall on CentOS. However, I receive a "Page cannot be displayed" error when I try to connect to FTP sites.
What should I do?
|
Add the below 3 lines to squid.conf, and reload squid. Should work for ftp upload and download via squid.
acl SSL_ports port 443 21
acl ftp proto FTP
http_access allow ftp
Visit for usefull squid tutorial
| Connecting to FTP sites via squid |
1,603,959,433,000 |
I set up SFTP, but I have a problem regarding iptables. Here are my rules:
A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT
A RH-Firew... |
SFTP and FTP are not the same thing.
If you really mean SFTP, that's an SSH-based transmission that takes place only over port 22 (unless you configure your SSH daemon to listen on another port).
FTP is an ancient file-transfer protocol that operates on ports and 21 (and possibly others). Firewalls need to do connect... | Why am I getting a "Listing remote folder failed" error when I try to connect with SFTP? |
1,603,959,433,000 |
I want to mount a remote FTP directory in linux. One of the main tools I found is curlftpfs.
However, when I mount the remote FTP directory and try to read its contents, I get the following error:
$ curlftpfs -o allow_other ftp://test.rebex.net testftp ... |
It seems like curlftpfs does not support the newer standartized FTP command MLSD used to retrieve the directory list. Some servers (like the test.rebex.net) most likely do not support the older (and not standartized) LIST -a command. There are forks of curlftpfs supporting MLSD command (like this), but I have not trie... | Reading mounted curlftpfs directory results in "Input/output error" |
1,549,997,873,000 |
I have CCTV server that is backed up daily to a remote ftp server using an lftp command. The CCTV server saves videos to a new folder each day, the backup runs once a day at 1am, so each backup only affects 2 folders. After 28 days the local copies are all deleted.
The command I currently use is:
mirror --reverse --us... |
After trying clearing the cache, and removing the --use-cache command entirely, my service provider admitted they were having "network issues" their end, which was causing ls commands to run very slowly.
Fortunately detailed logs from my end were able to demonstrate their error, and now show things running at full sp... | Why would an lftp mirror operation slow down over time? |
1,549,997,873,000 |
I have a versions/ directory on a remote server to which I have only rsync daemon and ftp access. This directory contains a set of subdirectories, each named after the datetime of a deployed codebase (e.g., versions/20150101000000/, versions/20150102120000/, etc.). I need to automate deleting old versions, and my intu... |
Thanks to a friendly IRC contact, I've found a working solution to delete a specific directory using a single rsync command. It works by specifying an --include argument for the contents of the directory (--include '/20150101000000/**'), a separate --include for the directory itself (--include '/20150101000000/'), and... | Delete destination directories with rsync (contents as well as parent) |
1,549,997,873,000 |
I am having a script which pulls data from different servers whose details it reads from external file. It reads the files and the verbose output shows all the matching files but it fetches only one file from the remote host. Following is my script:
while IFS=','; read region sdp ip1 ip2 ip3 user1 pass1 user2 pass2 us... |
I have got some pointers from Jeff. Somehow the prompt off was not working and i was getting prompt to get the matching files. I have tried putting the 'y' below the mget command and it worked. Following is the updated code:
while IFS=','; read region sdp ip1 ip2 ip3 user1 pass1 user2 pass2 user3 pass3
do
in=/var... | Why won't my FTP script get all the files using mget command? |
1,549,997,873,000 |
I have connected 2 PCs using ethernet cable and set up FTP on one of them to transfer some >100GB of files. However, trying to download it, I run into a problem of speed not more than 50kB/s. It happens whether I download through Nautilus or Filezilla.
However, if I try to download a large file using Google Chrome, i... |
I found it. The problem was far not in the connection, it is in the file system. I was trying to copy from NTFS to NTFS. When I formatted the receiving FS to ext4, speed increased to 40+MB/sec.
| Super-slow LAN speed, unless downloading through Chrome's FTP client [closed] |
1,549,997,873,000 |
ftp -n ${FTP_HOST} << STOP
user ${FTP_USERNAME} ${FTP_PASSWORD}
binary
lcd ${FTP_FROM_DIR}
cd ${FTP_TO_DIR}
put ${reportFileName}
STOP
That is my code which is not successfully copying the file to remote host but using it manually it successfully copies the file to remote host.
When ran from a... |
I suspect part of your issue is with the way you're constructed your heredoc. Try it like so:
$ ftp -n ${FTP_HOST} << STOP
user ${FTP_USERNAME} ${FTP_PASSWORD}
binary
lcd ${FTP_FROM_DIR}
cd ${FTP_TO_DIR}
put ${reportFileName}
STOP
If you truly want those spaces/tabs in the command then you'll need to change to th... | FTP "put" not copying file to remote host when ran from shell script but copies the file to remote host when ran manually |
1,549,997,873,000 |
I had to transfer a few videos and photoes on a FTP server.
For that, the person on the remote machine gave me the IP address of that machine where I had to transfer. He told me to transfer by FTP. And he provided me with username and password for the same.
He was expecting that I have Windows OS here locally and so... |
It seems that the FTP server allows anonymous FTP: FTP where the username is conventionally anonymous and every password is accepted. Your FTP client tried an anonymous FTP login, and this succeeded. The files are in whatever directory is the default directory for anonymous users; this is determined by the FTP server ... | FTP transfer: I can see files on remote machine, but remote user can't |
1,549,997,873,000 |
I am Trying to configure ProFTPd to change group for newly created files/directories.
In my config I have this:
<Directory /home/*>
GroupOwner www
</Directory>
Which does not seem to work.
All users are added to www group.
Debug shows nothing regarding to a group change.
I'm using FREEBSD 9.0-release.
EDIT: I'm wil... |
After a deep research, I found out that proftpd is not capable of changing a group of newly uploaded file..
However workaround was found:
You need to simply change group for the user's home folder, after which all newly uploaded files will inherit the group from the home folder.
Not much of a solution, but at least so... | proftpd does not change default group for new files |
1,549,997,873,000 |
I'm setting up a proFTPd server so I can upload files to my webserver, but I've never tried this before. I've installed proftpd, added a user with a home folder: /home/FTP-shared and added /bin/false shell to it as well.
But what do I do configuration-wise now in proftp to be able to login with this user, and up and d... |
For your first question, you can read it here.
For your second question, I'm currently using mount --bind.
| Creating a proFTPd user |
1,549,997,873,000 |
I have an FTP server (Debian) setup where users send JPG images.
I need a process running on the background that every time a picture is sent via FTP a bash script is executed for generating thumbnail files for each image uploaded.
I already have the script that generates the thumbnail, the problem is it needs to be... |
Consider using inotifywait
eg watch a directory
inotifywait .
Then create a file in that direectory.
Here's a previous answer from Unix/Linux stackexchange
| Running a bash script each time a file is uploaded? [duplicate] |
1,549,997,873,000 |
I use a script for work that invokes lftp to mirror a directory:
#!/bin/bash
HOST='ftp.example.com"
USER='pretenduser'
PASS='pretendpass'
TARGETFOLDER='/home/pretenduser/Dropbox/lftp'
SOURCEFOLDER='/files/Inbox'
LOG='/home/pretenduser/Scripts/lftp.log'
lftp -c "
set ftp:ssl-allow no
open $HOST
user $USER $PASS
mirro... |
As Gilles commented, your redirection is on a separate line, which means it's a separate (empty) command. The lftp command ended with the ending double-quote.
Simply change the lftp command to:
lftp -c "
set ftp:ssl-allow no
open $HOST
user $USER $PASS
mirror --verbose --delete $SOURCEFOLDER $TARGETFOLDER
bye
" >> $LO... | Simple question: lftp not writing to $LOG --- what am I doing wrong? [closed] |
1,549,997,873,000 |
After reading through this tutorial I still have a persistent question.
In the beggining of the article the writer says:
Warning: FTP is inherently insecure! Consider using SFTP instead of FTP.
I am assuming that he might mean FTPS (as I think that is what his article explains but I am not sure).
However, at the bot... |
SFTP and FTP are, in fact, different protocols. SFTP is actually built on top of SSH, the Secure SHell protocol, while FTP-over-SSL (aka FTPS) is simply vanilla FTP over an encrypted transport-layer connection, the same as HTTPS IS HTTP over an encrypted connection.
If I'm not mistaken, it would be possible for a plai... | When FTP Requires FTP over TLS is it FTPS? |
1,317,280,996,000 |
I have a minimal install of Centos in VirtualBox. I want to run a ftp service to share files between the host and my VM, and then learn about ftp servers.
I installed vsftpd and changed the vsftpd.conf file as bellow:
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=O22
dirmessage_enable=YES
xfer... |
You have a space between xferlog_std and format=YES according to the configuration you supplied.
Also, you might wish to compare with a working configuration:
$ sudo cat /etc/vsftpd/vsftpd.conf | grep -v "#"
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_wr... | Centos: VSFTPD not Starting |
1,317,280,996,000 |
The download accelerators I've found thus far only let me specify a single file to download. This is useful for single large files, but I'm looking for a tool that lets me hand over a list of multiple files to download simultaneously.
In some cases I would want to download the entire list in the traditional accelerate... |
lftp can do that.
You've got:
pget to download a single file with several connections
mirror -P 4 to download a tree with up to four connections
and you can put any get in background to start another one with get file & (also Ctrl-Z to put a download in background when using it interactively).
You can set the numb... | Console download accelerator that downloads *multiple* files simultaneously |
1,317,280,996,000 |
today I wrote a script which should copy all files per ftp to my destination server.
Script is executed inside zsh-shell, so I guess I should use "sh script.sh" to execute it correctly?
Also I pasted my script to https://www.shellcheck.net/, which says its fine, but inside my zsh-shell I get following errors:
upload_f... |
The immediate problem is that the function you declare is not visible to the second bash instance you run from find ... -exec. https://shellcheck.net/ probably just sees a single-quoted literal string, and does not look inside it for problems.
Using sh to run a Bash script could also be a problem. Your script doesn't ... | Shellscript which copies all files automatically per ftp |
1,317,280,996,000 |
I am trying to set up an FTP server on one of my devices that runs DietPi and I selected proFTPD as a server.
I have installed the software and followed some set-up information I found here. But then I noticed that the service was not running. After trying to find it in via ps aux | grep proftpd I did not succeed.
Aft... |
The strace output indicates that the error is caused by the attempt to create /run/proftpd.sock, which apparently already exists.
Try fuser /run/proftpd.sock to see if any process is holding onto it; it will report the PID numbers of any such processes. Then use ps -fp <PID number here> to get more information about t... | proFTPD not working due to socket bind error |
1,317,280,996,000 |
When I upload my backup using ftp to my backup server, my upload speed get to 1.5Gb/s which is good!
BUT I see strange things on download traffic!!
When my upload speed get bigger than 1Gb/s I see download traffic upto 10Mb/s.
I don't know whats really going on here!?
there is no app which cause this download traffic ... |
The chances are that the unexpected inbound traffic is simply acknowledgements of the data you're uploading. Assuming it's TCP/IP rather than UDP, of course. I would have thought 100:1 a little strong, but it is quite plausible.
Best thing might be to run something like ntop to see whether the incoming traffic address... | Got Download Traffic While Uploading With High Speed |
1,317,280,996,000 |
How can I inspect ftpd(the regular Linux FTP server's) source code on my machine?
I'm using Debian 9. Unfortunately I can't figure out which exactly implementation has the package ftpd which I previously installed through apt install ftpd.
|
Since you’re using Debian, if your repositories are set up correctly (and they are by default),
apt-get source ftpd
will download and extract the source code for your ftpd package in a sub-directory of the current directory — on Debian 9, that will be ftpd-0.17-36.
This works for any package downloaded from the Debia... | Where can I find the source code of ftpd? |
1,317,280,996,000 |
I've gone through all the possible threads and answers and still I'm not sure how to achieve this. Is following scenario even possible in the first place?
I've ubuntu 16.04 server which has OpenVPN installed and running. I can connect to this VPN through Windows client. The server also hosts some files that I need an ... |
You have several options.
Configure your FTP server to listen only your OpenVPN interface/address.
Use iptables to filter out traffic from other than OpenVPN interface. If your default policy is DROP and your OpenVPN interface name is tun0 to accept all traffic from OpenVPN interface:
iptables -A INPUT -i tun0 -j ACC... | Allow FTP only through VPN |
1,317,280,996,000 |
I have a couple of FTP users who can access my (pseudo) server running vsftpd under Mint Linux. They are restricted to a specific directory and below via chroot(). Whilst they can access the files without problem they are unable to delete them when they are no longer required. The permissions on their base directory, ... |
Are the users local users or vsftp users ?
Try the following:
grep local_enable /etc/vsftpd/vsftpd.conf
That should be set to YES and the users should log in with local accounts for this to work.
If you do not want this or already have this set, please paste your /etc/vsftpd/vsftpd.conf here.
| Unable to delete files via FTP? |
1,317,280,996,000 |
I'm using a raspberry pi3 and VSFTPD to share a directory via FTP, which allows a camera to connect to it and transfer photos.
I also created a simple user & password and chrooted the directory so there's no file browsing outside of the dedicated folder if using FileZilla or any other tool.
The problem is, if i log in... |
If you want to disable SSH (including scp & sftp) logins for a particular user, you could simply add DenyUsers <name of the ftp-only user> to /etc/ssh/sshd_config and restart the sshd daemon.
It will leave the possibility of using the FTP-only account to log in locally, but if the system is in a secure location, that ... | Disable terminal access but keep FTP |
1,317,280,996,000 |
Currently, I am trying to run ftp commands from telnet client. I was successful with USER, PASS, PASV, LIST and when tried PORT vsftp server is throwing 500 Illegal PORT command. I am following the syntax as specified in RFC 959
DATA PORT (PORT)
The argument is a HOST-PORT specification for the data port
to be use... |
In olden days when the world was young, pterodactyls still flew in the sky, a computer that was able to connect to a IP network cost $100,000 (and those were real dollars) and most of the system administrators of those machines knew each other on a first name basis, it was decided to partition the 65535 TCP ports (or... | vsftp server returning 500 Illegal PORT command when tried to run raw ftp commands in telnet |
1,317,280,996,000 |
I have a case when I need to move data from an old server: host1 to a new server: host2.
The problem is host1 cannot see host2, but I can use another server (localhost) to SSH to both host1 and host2.
Imagine it should work like this: host1 -> localhost -> host2
How can I use rsync to copy files between host1 and hos... |
I ended up with the solution from https://unix.stackexchange.com/users/312074/eblock
with
scp -3 host1 host2
| How to use rsync to copy files between 2 remote servers based on the localhost server? [duplicate] |
1,317,280,996,000 |
How could I modify the script below to include the source directory so that it will know which location to retrieve the files required for transfer?
I have a bash script for the purpose of automatically transferring files to a remote server, which occurs once a week.
Here is the script:
#!/bin/bash
HOST=sftp.mydomain... |
To change which directory the ftp process sees as the source, either cd there beforehand or lcd there within:
1.
cd /source/directory
ftp ...
2.
ftp ...
lcd /source/directory
...
lcd (from man ftp) is short for local change directory; it will:
Change the working directory on the local machine.
"Local" here means t... | Automated FTP Script Not Finding Source Directory |
1,317,280,996,000 |
It used to be that you could force command line FTP to use IPv4 like so:
ftp -4 ftp.example.com
However, at some point in the relatively recent past the "-4" (and for that matter, the "-6") option seems to have been removed. Despite exhaustively searching the Web (even for the exact error "ftp: 4: unknown option") I c... |
-4 and -6 are options added by a patch in the Debian version of netkit-ftp; you’ll find these available in any Debian derivative. Fedora, RHEL and CentOS don’t have an equivalent patch, so their ftp doesn’t support these options.
To force IPv4, you could try specifying the target IP address rather than the host name.
| What happened to the "-4" option for command line FTP? |
1,317,280,996,000 |
Sorry, but this is probably a terribly stupid question.
I'm running a Linux2 instance on AWS.
I have a number of sites running there, including a couple of wordpress sites.
One of the sites wants an FTP account so they can edit their wordpress files directly.
I want to create an FTP account and lock it to the site dir... |
Have a look at groups : https://www.linux.com/learn/intro-to-linux/2017/12/how-manage-users-groups-linux . It basically allows you to set the rights of several users over files and directories.
More info : https://www.howtoforge.com/tutorial/linux-groups-command/
https://wiki.archlinux.org/index.php/users_and_groups
| adding FTP user without changing owner of directory? |
1,317,280,996,000 |
This is the bash code:
ftp -n <ftpadress> <<EOT
<credentials>
binary
put $pathfile$reportfile $remotepath$reportfile
put $pathfile$logfile $remotepathlog$logfile
quit
EOT
This is the output:
a <files_to_add>
put <files_to_add_with_path> <files_to_add_with_remote_path>
The parameter is incorrect.
I checked the a... |
As @Kusalanada suggested, Windows did not like the symbol ":"
I changed the name of the file, from
file_2019-06-11_14:54:37.tar
to
file_02019-06-11_145437.tar
| File is not sent via ftp - error: "The parameter is incorrect" |
1,523,959,599,000 |
This script will send a file via FTP and then delete it. But, sometimes, the file is deleted before the transmission ends, and then an empty file is received.
#!/bin/bash
tar czf <sourcefile> --directory=<directory> log
ftp -v -n $1 <<END_OF_SESSION
user <user> <password>
put <sourcefile> <targetfile>
bye
END_OF_SESS... |
The ftp command has no functionality to allow you to check for successful transfer. If you must continue using this implementation of FTP transfer, two alternatives are:
Download the transmitted file to a local temporary and compare it byte for byte against the source.
Run ls within the FTP client and check that the ... | Check if a file has been properly transmitted via FTP |
1,523,959,599,000 |
I have a script that generate a log and in the end of the script i move the log to a windows server. The connection between the 2 servers is fine, if i try to send the files manually it works good.
Script and logs are in 2 different location.
My script is like below:
LOGFILE=/home/logs/monitor_sync_FM2.log
HOST='xxx.x... |
You're trying to write the file to the path /home/logs/monitor_sync_FM2.log on the remote server (ie windows). 550 Filename invalid indicates that /home/logs does not exist on the remote server. What you want to do is this:
LOGFILE=monitor_sync_FM2.log
HOST='xxx.xxx.xxx.xxx'
USER='FTPUser'
PASSWD='Password'
cd /hom... | 550 Filename invalid |
1,523,959,599,000 |
I broke my debian permissions by doing: chmod 770 /etc as root.
I know its almost impossible to fix this without reinstalling but is it atleast possible to backup the files I created? I still have root access at the moment with putty.
I tried to copy files with sftp in filezilla what used to work fine before but brok... |
Change permissions to /etc to 755. Then go to /etc/ssh folder and change permissions according to these below:
-rw-r--r--. 1 root root 242153 Mar 16 2016 moduli
-rw-r--r--. 1 root root 2208 Mar 16 2016 ssh_config
-rw-------. 1 root root 6702 Jun 28 16:36 sshd_config
-rw------- 1 root ssh_key... | Debian backup files after chmod 770 in /etc |
1,523,959,599,000 |
I'm actually having error on this setup. I'm getting 500 Illegal PORT command. 425 Use PORT or PASV first when go using command PUT.
I'm currently using CENTOS 7.2
Here's my vsftpd.conf:
anonymous_enable=NO
listen_port=58021
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
xf... |
I think there is a problem with your ftp client.
The PORT command is sent by the FTP client. If the supplier sends a PORT command with a 10.x.x.x address all the way to the server that will never work because the 10.x.x.x is a private range. There are only two ways that a client can send 10.x.x.x in a port command... | Setting up FTP Server (Passive) vsFTPd CENTOS7 issue |
1,523,959,599,000 |
I am quite new to using linux and I am wondering if, in most circumstances there is a default ssh and or ftp server running.
I have started a few virtual machines and I have always been able to ssh into the computer, but I am not sure if this is the case (meaning that I can expect to connect to them or do I have to in... |
It's hard to ask a question about linux distros in general, because some might... but, this is my experience with it, using primarily Ubuntu 14.04 server every day at work, setting up and configuring servers.
There's not one that comes preinstalled (unless you select it at the last point of the install process - insta... | Is there a default ssh server or ftp server running on most linux distros? |
1,523,959,599,000 |
I've installed vsftpd and filezilla locally on my pc(ubuntu 12.04)
I can enter ftp via filezilla using 0.0.0.0 and it works.
How can i access to ftp from outside of my computer?
What address should i use?
vsftpd.config
listen=YES
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=... |
You can still bind it to 0.0.0.0, however you have to open the port with your firewall interface (depends, probably ufw or iptables on ubuntu). 0.0.0.0 binds to all interfaces (localhost as well as for example your ethernet interface).
I recommend to search in the ubuntu documentation about firewalls.
If your computer... | vsftpd and filezilla |
1,523,959,599,000 |
I installed git on my server and cloned my development repository using the root user. The permissions appeared to have been set to:
Files: -rw-r--r--
Directories: drwxr-xr-x
I previously had been using an FTP client to upload files. I need to still be able to use the FTP editor sometimes, but now when I try up... |
Would the correct approach here be to change the "owner" of the files from what I assume is root to my FTP user?
Yes. As root, run chown -R yourftpuser:yourftpgroup /path/to/tree. Your permissions will be fine for FTP at that point. All files will be owned by the FTP user, who has write access¹.
In future, you can a... | What should file permissions be set to in order for an FTP editor to work? |
1,523,959,599,000 |
I tried hard but not able to give access of web directory to other user for FTP.
Below are the directories which are under directory /var/www/html
1) nice_call
2) poor_call
3) great_call
/var/www/html is owned by apache user as well as all above mentioned directories is also owned by apache.
I just want to give read+... |
Set up your user ftp_user so that they can FTP successfully into their home directory. Assuming you're using vsftp as your FTP server; you'll need the following as a minimum in your /etc/vsftpd.conf:
anonymous_enable=NO
local_enable=YES
write_enable=YES
Within the user's home directory create a directory called (eg) ... | How to give apache web directory access to other FTP user where parent directory is restricted |
1,523,959,599,000 |
Is it possible to hide the php files or hide a folder with php files from FTP user accessing? But the files can be executed on a webserver?
|
You may hide those files using the HideFiles directive. Then you must treat those files as if they don't exist, using the IgnoreHidden directive.
| hiding a php file/folder with php file from ftp user |
1,523,959,599,000 |
I need to connect to a Remote FTP host via linux command line. When I try #ftp <IP address>, it prompts for username then password.. But I would like to pass username and password in single line, so remote host should not prompt username or password..
I tried passing as #ftp <ip address> <pw.cfg>, but no success. May ... |
You can use .netrc file in your home directory. In the file enter record like:
machine machine_name user username password your_password
and when you enter:
ftp machine_name
ftp will user user_name to login and your_password as password
| Could not pass the username password for FTP command from linux |
1,523,959,599,000 |
I want to create an anonymous ftp. The user can upload and read only from pub directory.
The OS is Unixware 71, the ftp server is WU-FTPD.
This is the ftpaccess file
#ident "@(#)unixsrc:usr/src/common/cmd/cmd-inet/usr.sbin/in.ftpd/ftpaccess /main/1"
#
# ftpd configuration file, see ftpaccess(4tcp).
#
loginfails ... |
Solution found on other forum
I had to copy a shared library in the chroot ftp.
mkdir -p /home/ftp/usr/lib
cp /usr/lib/libc.so.1 /home/ftp/usr/lib
| What's the error on my anonymous ftp server? The upload works, the read not |
1,523,959,599,000 |
The following two rules allow for passive transfers which i added as Firewall rules for my FTP server.
//The following two rules allow the inbound FTP connection
iptables -A INPUT -s $hostIP -p tcp --dport 21 -i eth0 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -d $hostIP -p tcp --sport 21 -o eth0 -m ... |
I assume $hostIP in your rules means a host you wish to allow FTP access for, otherwise your existing rules won't make sense to me.
If you are using unencrypted FTP, you should replace your wide-open FTP data connection rules with connection tracking.
First, add a rule that attaches a FTP connection tracking helper to... | How to make Firewall rules for Passive FTP which uses dynamic port? |
1,523,959,599,000 |
I am setting up my home camera to record to my NAS server (CentOS 8 Stream). I am using FTP for the transfer. I installed vsftpd and created a dedicated user (ftpuser). I want the files to be transferred to /data/recordings, which is also a Samba share: \mynas\recordings.
When I set the destination for the FTP transfe... |
This should solve it without the need to change the security context of files:
sudo setsebool -P samba_export_all_ro=1
sudo setsebool -P samba_export_all_rw=1
(probably the second command alone is enough, I've not tested).
| SELinux issue with FTP/Samba/Home directory |
1,624,460,440,000 |
I know ftp client(classical ftp client of Unix, for example kftp or netkit-ftp binary) use the file $HOME/.netrc.
The syntax is really simple
machine ftpservername login myname password *******
But if I want for example to turn on or off the prompt(prompt off command) there is no $HOME/.ftprc?
Is possible to put conf... |
Solution found.
First the only rc file of ftp client is $HOME/.netrc there is not ftprc at least under netkit-ftp.
For commands is really simple, we can define and use macros.
cat $HOME/.netrc
machine ftp.myserver.priv login anonymous password anonymous
macdef macrodef1
prompt off
The last line must be empty or retur... | ftp client: no rc file? |
1,624,460,440,000 |
I've created a user jdoe and I wanted to map such a user to apache user. So everytime that I upload a file could be owned by apache.
This is my /etc/vsftpd/vsftpd.conf file:
listen=YES
listen_ipv6=no
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connec... |
Finally I've found a way:
listen=YES
listen_ipv6=no
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
log_ftp_protocol=YES
connect_from_port_20=YES
ascii_upload_enable=YES
ascii_download_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
ls_recurse_en... | vsftpd: 550 Permission denied trying to uploading/writing files |
1,624,460,440,000 |
We will start to use SFTP instead of FTP for Tibco BW 5 application on RHEL 6. The port 22 is already open. Can i keep the same user account and directory for SFTP? If so, should i change any directory/user permissions?
|
That's bit too broad question. It depends on what FTP and SFTP server software you are using and how those servers manage the user accounts. But I'll try to answer anyway, to give you some clue, what to look for. If you give us more details, you might get better answers.
You might use the same software for both FTP a... | Migration from FTP to SFTP with the same user |
1,624,460,440,000 |
I'm building a website, which I'm pushing online using Filezilla. But this is monotonous and I'm sure could be done with a script. So far I figured out this much:
I connect with the ftp server using ftp mydomain.com I give my credentials and all is great. But this is how my project files look like:
asset-manifest.json... |
Ok this is how I ended up doing it:
yarn build
ncftpput -R -v -u "User" -p "Password" domain /path/to/ build/*
I used this answer:
https://superuser.com/a/841862
| Pushing files and folders to a specific folder on ftp |
1,624,460,440,000 |
There is a remote FTP server, which has my VPN Gateway IP address in white list. I have a name of FTP server, username and password. How can I connect to it? (I need my connection to go through VPN)
|
# route add <name-or-ip-of-ftp-server> gw <gateway-ip>
$ ftp <name-or-ip-of-ftp-server> [<port>]
then type your username and password
| How to connect to ftp server trough VPN |
1,497,627,506,000 |
An embedded device, running eCos OS, with FTP Lite Client. I want download file from device to local PC via FTP during terminal session. FTP transfer initiates device, it ask to specify the FTP IP address, file name, user name and password. Once details entered, it starts FTP transfer. Device not allow connect FTP cl... |
How to setup FTP application on Ubuntu for this purpose?
You need an FTP server that will allow uploads.
I recommend vsftpd; here is a page that explains how to configure it for upload:
https://www.centos.org/forums/viewtopic.php?t=39485
| FTP download question |
1,497,627,506,000 |
I wanted to share a tar file on my server so that anyone on my network can download it. For example, I would give them a link like
192.168.2.2/windows.tar
They should be able to download it from their web browser with that link or
wget 192.168.2.2/windows.tar
does anyone have any suggestion on what package I can u... |
There are two possible packages to use -- httpd, or nginx. Both are provided by CentOS 7.
httpd is better known as Apache Web Server, and its documentation is available by googling "centos 7 httpd"
nginx is a much smaller and lighter web server, and its documentation is available by googling "Centos 7 nginx
Either on... | CentOS 7 Share a file on my network so anyone can download it |
1,497,627,506,000 |
I'm setting up a new linux server and have installed VSFTPD. I can login to FTP fine using the root user, but not using my new user "AMP". I'm using the same password I'd use to login as AMP in SSH so it's not a wrong password.
I've looked around and found there is a userlist setting... but I've set it to NO hoping th... |
Found the answer here -
New local user can't login to vsftpd
Added the /bin/false shell to my user in /etc/passwd ... and then added that shell to the list in /etc/shells. Tried to login and it worked!!!
| Login incorrect when trying to login to VSFTPD |
1,497,627,506,000 |
I am attempting to download a folder where it has 777 permissions as well as its subfolders, but when I try to use get in ftp, It brings back the error:
550 Failed to open file
Iv'e checked the permissions:
ubuntu@ubuntu:~/sourceDev/7-1-15_asm/4$ ls -l
total 1748
-rwxrwxrwx 1 ubuntu ubuntu 164 Jul 5 09:21 brianTh... |
FTP clients aren't particularly good at downloading whole directories.
Try using wftp with its useful "-r" option. "-l 0" ensures it isnt limited to 5 levels of directory.
wget -r -l 0 ftp://user:[email protected]/7-1-15_asm/4
| How do I retrive files using an internet connection and commands? |
1,497,627,506,000 |
Host is 11iV3.
I am trying to log ftp transfert outside syslog.log
in /etc/inetd.conf
ftp stream tcp6 nowait root /usr/lbin/ftpd ftpd -u 022 -o -i -X
where
-i/-o tell ftpd to log input/output
-X tell ftpd to use syslogd facilities
in syslogd.conf
mail.debug /var/adm/syslog/mail.log
*.info;ma... |
Solution:
Inetd
1) you must log ftp/fptd traffic. in /etc/inetd.conf add following arguments
ftpd -l -v -o -i -W
where
-l log traffic to syslog.log
-v add verbosity
-i log incomming files (to /var/adm/syslog/xferlog)
-o log outgoing files (to /var/adm/syslog/xferlog)
-W tell ftpd to use syslog's configuration
syslo... | HPUX logging ftp connection |
1,497,627,506,000 |
How can I write ftp command for a file transfer from one server to other with a simple script?
|
lftp (and a lot of other ftp clients) will let you specify username, password, and the series of commands to issue with its command line. man lftp for more details.
| How can I write ftp command for a file transfer from one server to other? |
1,497,627,506,000 |
I need to open port 21 on a Linux (CentOS 5) virtual machine I have. I have tried several Google solutions, but none are working. I was wondering if someone could tell me how to do this.
Below is the output of netstat -tulpn:
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 3576... |
I figured it out. I don't have an FTP server running on the machine I am trying to connect to.
| How can I open port 21 on a Linux VM? |
1,497,627,506,000 |
I am hoping you can help out. Our DevOps guy is out of the office at our agency and our partners need access to our FTP. We have it locked down to our office but need to open it so that people outside our office can connect for a few weeks while development from our partners complete work.
Unfortunately, I have limite... |
Your CentOS system is using Firewalld, so you'd want to update the firewall configuration using it. You'd use the firewall-cmd command to modify the rules. For example, to allow the FTP service on the public zone, you'd use:
# firewall-cmd --add-service=ftp --zone=public
You can see that there are rules already def... | Need help with firewall - Accept FTP connections from outside |
1,497,627,506,000 |
I am trying to transfer files from a remote server to my local machine using FTP. I am ssh'd on to the remote server and want to connect to my local machine. The remote server runs on a Linux operating system whereas my local machine runs on a Windows operating system. I know how to transfer files to and from the remo... |
If you know how to transfer the files when initiating the transfer from your local machine, then just open another window and do it.
I should point out that using FTP for file transfers is insecure.
FTP also doesn't work well with NAT routers.
If your need to initiate the transfer from the remote side, create a revers... | How to transfer files from remote server to local machine when ssh'd in to remote server |
1,497,627,506,000 |
I am working on a linux server remotely. Are there any command that can allow me to figure out the IP address of this linux server, so that I can ftp some files to this server.
|
if the remote machine is directly connected to the internet:
hostname -I|cut -f1
otherwise, one of these:
wget -qO - http://whatsmyip.me/
wget -qO - http://ipinfo.io/ip
wget -qO - http://ipecho.net/plain; echo
In all cases, must be run on the remote machine.
| check ip address of a linux server to upload the file [duplicate] |
1,497,627,506,000 |
What is the method to block a machine from establishing connection to an outside ftp server. Both ftp and sftp.
inet, iptables, shutdown service?
|
I'm guessing, but it looks like you want to block connections to port 21 and port 22 . This can be done on the host itself for ftp
iptables -I OUTPUT -p tcp --dport 21 \
-d the.rem.ote.ip \
-m comment --comment "blocked as per ticket##" \
-j REJECT
SFTP, though, is tricky: it shares a port with ssh. If you are oka... | How to stop outbound ftp from being established. centos/ rhel |
1,447,875,240,000 |
I'm new to bash script, I need to create sub folders under each directory containing specific name in ftp server.
eg:
A1/B1/Name1
|
|_C1
|_C2
A1/B1/Name2
|
|_C1
|_C2
A1/B1/Name3
|
|_C4
|_C5
A1/B1/Name4
|
|_C1
|_C2
My main directory is A1/B1 where I have Name1,2,3,4 subdirectories that has sub folders C1,C2.
I need to... |
#! /bin/sh -
cd A1/B1 || exit
ret=0
for dir in */; do
if [ -d "${dir}C1" ] && [ -d "${dir}C2" ]; then
mkdir -p -- "${dir}CX" || ret=$?
fi
done
exit "$ret"
| bash script that find the specific folders in sub directory and create directory in all directories recursively |
1,447,875,240,000 |
I would have an exam in few days about basic stuff on linux(I'm not familiar with linux therefore I'm studying for it). There would be two linux machines VM1 and VM2 on VMware, that connect via ethernet. I created on my PC this environment to prepare myself (two linux vms on vmware). the first task is to ping between... |
The exercise you posted must be run on a lab that is already set up, with VM_2 containing a FTP server and a custom shell script start_ftp that starts the FTP server. It won't work on a random Linux machine.
If you don't have access to such a lab, you can install any FTP server via the package manager of your Linux di... | FTP to download file from one linux to another |
1,328,908,576,000 |
I know that shell scripts just run commands as if they were executed in at the command prompt. I'd like to be able to run shell scripts as if they were functions... That is, taking an input value or string into the script. How do I approach doing this?
|
The shell command and any arguments to that command appear as numbered shell variables: $0 has the string value of the command itself, something like script, ./script, /home/user/bin/script or whatever. Any arguments appear as "$1", "$2", "$3" and so on. The count of arguments is in the shell variable "$#".
Common wa... | How can I pass a command line argument into a shell script? |
1,328,908,576,000 |
Noone should need 10 years for asking this question, like I did. If I were just starting out with Linux, I'd want to know: When to alias, when to script and when to write a function?
Where aliases are concerned, I use aliases for very simple operations that don't take arguments.
alias houston='cd /home/username/.scrip... |
An alias should effectively not (in general) do more than change the default options of a command. It is nothing more than simple text replacement on the command name. It can't do anything with arguments but pass them to the command it actually runs. So if you simply need to add an argument at the front of a single c... | In Bash, when to alias, when to script and when to write a function? |
1,328,908,576,000 |
source some_file
some_file:
doit ()
{
echo doit $1
}
export TEST=true
If I source some_file the function "doit" and the variable TEST are available on the command line. But running this script:
script.sh:
#/bin/sh
echo $TEST
doit test2
Will return the value of TEST, but will generate an error about the unknown fu... |
In Bash you can export function definitions to other shell scripts that your script calls with
export -f function_name
For example you can try this simple example:
./script1:
#!/bin/bash
myfun() {
echo "Hello!"
}
export -f myfun
./script2
./script2:
#!/bin/bash
myfun
Then if you call ./script1 you will see t... | Can I "export" functions in bash? |
1,328,908,576,000 |
I can define bash functions using or omitting the function keyword. Is there any difference?
#!/bin/bash
function foo() {
echo "foo"
}
bar() {
echo "bar"
}
foo
bar
Both calls to functions foo and bar succeed and I can't see any difference. So I am wondering if it is just to improve readability, or there is so... |
There is no difference AFAIK, other than the fact that the second version is more portable.
| difference between "function foo() {}" and "foo() {}" |
1,328,908,576,000 |
At work, I write bash scripts frequently. My supervisor has suggested that the entire script be broken into functions, similar to the following example:
#!/bin/bash
# Configure variables
declare_variables() {
noun=geese
count=three
}
# Announce something
i_am_foo() {
echo "I am foo"
sleep 0.5
ech... |
I've started using this same style of bash programming after reading Kfir Lavi's blog post "Defensive Bash Programming". He gives quite a few good reasons, but personally I find these the most important:
procedures become descriptive: it's much easier to figure out what a particular part of code is supposed to do. I... | Why write an entire bash script in functions? |
1,328,908,576,000 |
When I define a new alias in .bash_aliases file or a new function in .bashrc file, is there some refresh command to be able immediately use the new aliases or functions without closing the terminal (in my case xfce4-terminal with a few tabs open, many files open and in the middle of the work)?
|
Sourcing the changed file will provide access to the newly written alias or function in the current terminal, for example:
source ~/.bashrc
An alternative syntax:
. ~/.bashrc
Note that if you have many instances of bash running in your terminal (you mentionned multiple tabs), you will have to run this in every instan... | Refresh aliases and functions after defining new aliases and functions? |
1,328,908,576,000 |
After reading ilkkachu's answer to this question I learned on the existence of the declare (with argument -n) shell built in.
help declare brings:
Set variable values and attributes.
Declare variables and give them attributes. If no NAMEs are given,
display the attributes and values of all variables.
-n ... make NA... |
In most cases it is enough with an implicit declaration in bash
asdf="some text"
But, sometimes you want a variable's value to only be integer (so in case it would later change, even automatically, it could only be changed to an integer, defaults to zero in some cases), and can use:
declare -i num
or
declare -i num=... | What is "declare" in Bash? |
1,328,908,576,000 |
So I started using zsh. I like it all right. It seems very cool and slick, and the fact that the current working directory and actual command line are on different lines is nice, but at the same time, I'm noticing that zsh can be a bit slower than bash, especially when printing text to the screen.
The thing I liked b... |
Environment variables containing functions are a bash hack. Zsh doesn't have anything similar. You can do something similar with a few lines of code. Environment variables contain strings; older versions of bash, before Shellshock was discovered, stored the function's code in a variable whose name is that of the funct... | what is the zsh equivalent of bash's export -f |
1,328,908,576,000 |
This is my code
#!/bin/bash
showword() {
echo $1
}
echo This is a sample message | xargs -d' ' -t -n1 -P2 showword
So I have a function showword which echoes whatever string you pass as a parameter to the function.
Then I have xargs trying to call the function and pass one word at a time to the function, and run ... |
Try exporting the function, then calling it in a subshell:
showword() {
echo $1
}
export -f showword
echo This is a sample message | xargs -d' ' -t -n1 -P2 bash -c 'showword "$@"' _
This causes xargs to execute
bash -c 'showword "$@"' _ This
bash -c 'showword "$@"' _ is
bash -c 'showword "$@"' _ a
︙
T... | How to use defined function with xargs |
1,328,908,576,000 |
I have a script that does a number of different things, most of which do not require any special privileges. However, one specific section, which I have contained within a function, needs root privileges.
I don't wish to require the entire script to run as root, and I want to be able to call this function, with root p... |
I will admit that there's no simple, intuitive way to do this, and this is a bit hackey. But, you can do it like this:
function hello()
{
echo "Hello!"
}
# Test that it works.
hello
FUNC=$(declare -f hello)
sudo bash -c "$FUNC; hello"
Or more simply:
sudo bash -c "$(declare -f hello); hello"
It works for me:
$... | Executing a Bash Script Function with Sudo |
1,328,908,576,000 |
I'm on Solaris 10 and I have tested the following with ksh (88), bash (3.00) and zsh (4.2.1).
The following code doesn't yield any result:
function foo {
echo "Hello World"
}
find somedir -exec foo \;
The find does match several files (as shown by replacing -exec ... with -print), and the function works perfectl... |
A function is local to a shell, so you'd need find -exec to spawn a shell and have that function defined in that shell before being able to use it. Something like:
find ... -exec ksh -c '
function foo {
echo blan: "$@"
}
foo "$@"' ksh {} +
bash allows one to export functions via the environment with export ... | Executing user defined function in a find -exec call |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.