小编use*_*823的帖子

"在MySQL中识别'密码'"

我经常在许多MySQL教程中看到人们IDENTIFIED BY 'password'在用户创建期间使用命令并授予他权限.

例如:

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON database.* TO 'username'@'localhost' IDENTIFIED BY 'password';
Run Code Online (Sandbox Code Playgroud)

我尝试使用GRANT没有IDENTIFIED BY,它的工作原理.
有人能解释一下为什么它会被使用两次吗?特定权限可以有其他密码吗?

mysql privileges grant

22
推荐指数
3
解决办法
6万
查看次数

sftp chroot目录上的公钥授权

我想将公钥授权添加到我的sftp chroot目录,但我总是得到:

debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/test/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
Couldn't read packet: Connection reset by peer
Run Code Online (Sandbox Code Playgroud)

Chroot有效,因为可以使用密码进行授权.我在没有chroot的主机上有其他帐户,它可以使用此密钥.我尝试了很多次,但它仍然没有用.

在auth.log中的服务器上只有:连接由xxx [preauth]关闭

这是我的目录:

ls -laR /sftp/
/sftp/:
total 12
drwxr-xr-x  3 root root 4096 May  3 16:55 .
drwxr-xr-x 23 root root 4096 …
Run Code Online (Sandbox Code Playgroud)

linux ssh sftp chroot

14
推荐指数
2
解决办法
2万
查看次数

bash循环的限制

我有大量创建虚拟文件和目录的问题.我想创建这样的东西:

dummy_directory_1/dummy_file_1
dummy_directory_2/dummy_file_2
dummy_directory_3/dummy_file_3
Run Code Online (Sandbox Code Playgroud)

使用循环:

for(( i=1; $i <=1000; i++ )); do 
   mkdir $(date --date="$i day ago" +%Y%m%d%H%M%S); 
   touch $(date --date="$i day ago" +%Y%m%d%H%M%S)/$(date --date="$i day ago" +%Y%m%d%H%M%S)_file; 
done
Run Code Online (Sandbox Code Playgroud)

并非所有文件都被创建,因为我收到以下错误:

touch: cannot touch `20140211230556/20140211230556_file': No such file or directory
touch: cannot touch `20131105230559/20131105230559_file': No such file or directory
touch: cannot touch `20130529000604/20130529000604_file': No such file or directory
Run Code Online (Sandbox Code Playgroud)

你知道bash/linux对文件创建有一些限制吗?当我使用grep编写用于搜索许多文件的脚本时,我遇到了类似的问题.如果我改变循环$i<=10它是有效的.请帮忙.

linux bash loops

6
推荐指数
1
解决办法
1218
查看次数

标签 统计

linux ×2

bash ×1

chroot ×1

grant ×1

loops ×1

mysql ×1

privileges ×1

sftp ×1

ssh ×1