You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用HDFS put命令上传patternsToSkip文件时遇权限拒绝错误求助

Let's break down your issue and fix it step by step:

First, let's understand the core problem from the error message:

Permission denied: user=root, access=WRITE, inode="/user":hdfs:hdfs:drwxr-xr-x

This tells us that the HDFS /user directory only grants write permissions to its owner (the hdfs user). All other users—including root and biadmin—only have read and execute permissions here. Directly uploading files to the /user root directory violates HDFS's security model, which is why your attempts are failing across different users.

You should use a dedicated user home directory in HDFS instead of writing directly to /user:

  1. Switch to the hdfs user (the only account with permissions to create directories under /user):
    su - hdfs
    
  2. Create a home directory for your target user (e.g., biadmin):
    hdfs dfs -mkdir /user/biadmin
    
  3. Assign ownership and proper permissions to let biadmin control the directory:
    hdfs dfs -chown biadmin:biadmin /user/biadmin
    hdfs dfs -chmod 755 /user/biadmin
    
  4. Exit the hdfs user session, switch to biadmin, and upload your file to the new directory:
    exit
    su - biadmin
    hdfs dfs -put patternsToSkip /user/biadmin/
    

If you need a quick test upload and don't mind the security risk, you can temporarily grant write access to all users on /user (remember to revert this afterward):

su - hdfs
hdfs dfs -chmod o+w /user
# Upload your file here
hdfs dfs -put patternsToSkip /user/
# Revert permissions immediately
hdfs dfs -chmod o-w /user

Note on Your Failed hdfs User Attempt

When you tried using the hdfs user, you might have had a path mismatch or weren't in the correct working directory. The hdfs user can write directly to /user, but it's still better practice to use /user/hdfs/ for its own files. Double-check that your local patternsToSkip file exists in your current working directory, or use an absolute path to specify it (e.g., hdfs dfs -put /path/to/patternsToSkip /user/hdfs/).

内容的提问来源于stack exchange,提问作者Sea Star

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:04:09