在我的 CentOS 7 机器上进行更新时,我注意到安装了一些 DRPM。在谷歌上做了一些搜索后,这个问题没有直接的答案,所以我认为它适合在这里提问。
我正在寻找一种方法来让 mount 命令提示输入密码,这样我的密码就不会出现在任何系统历史记录中,我以为我会让它read -s -p
在 mount 命令内运行命令,但我没有任何运气. 我想知道我的陈述是否错误以及如何错误。
mount -t cifs -o domain=domain.ad,user=thebtm,pass=$(read -s -p "password: ") "//NAS/thebtm$/" /mnt/cifsmount
password: mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Run Code Online (Sandbox Code Playgroud) 我有一个 bash 脚本,它接收一些文件并将它们设置为 FTP 到一个处理安装文件之一的站点。我们希望在本月的第一个星期一找到另一个文件,但我不确定如何将其放入 bash 脚本中。我见过使用 crontab 的东西,但脚本的第一部分和最后一部分完全相同,如果我们有 2 个不同的脚本,可能会导致问题。
只放入我正在考虑进行更改的脚本的一部分。
#!/bin/bash
...
e_file="/tmp/tmpemail.$(date +%s).txt"
file1='/usr/local/filename1'
file2='/usr/local/filename2'
relayserver='relay-server.example.com'
#ftp info
FTP_USER='ftpuser' #not the actual FTP User Name
FTP_DEST_PATH='/'
...
echo -e "Starting Tunnel and SFTP Process"
# make ssh tunnel for access to SFTP Site
ssh -L 9022:ftp.example.com:22 serviceaccount@$relay_server -Nf >/dev/null 2&>1
proc=`ps -ef | grep "ssh -L 9022\:ftp.example.com\:22" | awk '{print $2}'`
#checks to see if the tunnel opened correctly then proceeds to push to FTP Site
if …
Run Code Online (Sandbox Code Playgroud) 我正在使用 Linux Debian Jessie 64 位(主机),并在 Oracle VirtualBox 上运行 Windows 7(来宾)。我正在使用 youtube-dl 从 YouTube 下载视频。因为有朋友问我怎么用,她用的是Windows,我就在VirtualBox上试了一下教她。令我惊讶的是,通过 Linux 终端的下载速度为 200KB/s,而在 Windows 终端的下载速度为 4MB/s!我必须假设我的配置有问题,但我不知道它可能是什么。或者还有其他解释吗?
centos ×2
cifs ×1
command-line ×1
date ×1
download ×1
linux ×1
mount ×1
networking ×1
rpm ×1
shell-script ×1
virtualbox ×1
youtube-dl ×1