在/home目录下创建一个名为shared_files的目录,并设置其权限为所有用户可读、仅属主可写。

本文详细描述了通过命令行进行一系列IT技术操作,包括创建共享文件夹、打包备份文档、整理过期配置文件以及维护系统安全的步骤。

cd /home

mkdir shared_files

chmod 644  shared_files

cd /home/shared_files

  tar zcPf doc_backup.tar.gz  /usr/share/doc

cd ~

find /etc -name "*.conf" -mtime 7 > modified_confs.txt

vi  modified_confs.txt

(光标定在第一行)i(开始输入名字全拼)

:wq (注意冒号也要输入)

​​​​​​​reboot

shr@ubuntu:~/h_ws$ catkin_make Base path: /home/shr/h_ws Source space: /home/shr/h_ws/src Build space: /home/shr/h_ws/build Devel space: /home/shr/h_ws/devel Install space: /home/shr/h_ws/install #### #### Running command: "cmake /home/shr/h_ws/src -DCATKIN_DEVEL_PREFIX=/home/shr/h_ws/devel -DCMAKE_INSTALL_PREFIX=/home/shr/h_ws/install -G Unix Makefiles" in "/home/shr/h_ws/build" #### -- Using CATKIN_DEVEL_PREFIX: /home/shr/h_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/noetic -- This workspace overlays: /opt/ros/noetic -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3") -- Using PYTHON_EXECUTABLE: /usr/bin/python3 -- Using Debian Python package layout -- Using empy: /usr/lib/python3/dist-packages/em.py -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/shr/h_ws/build/test_results -- Forcing gtest/gmock from source, though one was otherwise available. -- Found gtest sources under '/usr/src/googletest': gtests will be built -- Found gmock sources under '/usr/src/googletest': gmock will be built -- Found PythonInterp: /usr/bin/python3 (found version "3.8.10") -- Using Python nosetests: /usr/bin/nosetests3 -- catkin 0.8.12 -- BUILD_SHARED_LIBS is on -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~ traversing 24 packages in topological order: -- ~~ - arbotix (metapackage) -- ~~ - arbotix_controllers -- ~~ - arbotix_firmware -- ~~ - arbotix_python -- ~~ - arbotix_sensors -- ~~ - plumbing_my (metapackage) -- ~~ - arbotix_msgs -- ~~ - d3_plug -- ~~ - hello_vscode -- ~~ - d4_n -- ~~ - plumbing_server_client -- ~~ - plumbing_test -- ~~ - pluming_pub_sub -- ~~ - ros3_1 -- ~~ - d1_action -- ~~ - d2_dr -- ~~ - rosbag_d -- ~~ - tf2_static -- ~~ - tf3_tfs -- ~~ - t2_dynamic -- ~~ - tf4_test -- ~~ - nav1_demo -- ~~ - urdf1_rviz -- ~~ - urdf2_gazebo -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- +++ processing catkin metapackage: 'arbotix' -- ==> add_subdirectory(arbotix_ros/arbotix) -- +++ processing catkin package: 'arbotix_controllers' -- ==> add_subdirectory(arbotix_ros/arbotix_controllers) -- +++ processing catkin package: 'arbotix_firmware' -- ==> add_subdirectory(arbotix_ros/arbotix_firmware) -- +++ processing catkin package: 'arbotix_python' -- ==> add_subdirectory(arbotix_ros/arbotix_python) -- +++ processing catkin package: 'arbotix_sensors' -- ==> add_subdirectory(arbotix_ros/arbotix_sensors) -- +++ processing catkin metapackage: 'plumbing_my' -- ==> add_subdirectory(plumbing_my) -- +++ processing catkin package: 'arbotix_msgs' -- ==> add_subdirectory(arbotix_ros/arbotix_msgs) -- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy -- arbotix_msgs: 2 messages, 4 services -- +++ processing catkin package: 'd3_plug' -- ==> add_subdirectory(d3_plug) -- +++ processing catkin package: 'hello_vscode' -- ==> add_subdirectory(hello_vscode) -- Installing devel-space wrapper /home/shr/h_ws/src/hello_vscode/scripts/h1_p.py to /home/shr/h_ws/devel/lib/hello_vscode -- +++ processing catkin package: 'd4_n' -- ==> add_subdirectory(d4_n) -- +++ processing catkin package: 'plumbing_server_client' -- ==> add_subdirectory(plumbing_server_client) -- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy -- plumbing_server_client: 0 messages, 1 services -- Installing devel-space wrapper /home/shr/h_ws/src/plumbing_server_client/scripts/d_server_p.py to /home/shr/h_ws/devel/lib/plumbing_server_client -- Installing devel-space wrapper /home/shr/h_ws/src/plumbing_server_client/scripts/d_client_p.py to /home/shr/h_ws/devel/lib/plumbing_server_client -- +++ processing catkin package: 'plumbing_test' -- ==> add_subdirectory(plumbing_test) -- Installing devel-space wrapper /home/shr/h_ws/src/plumbing_test/scripts/t1_pub_twist_p.py to /home/shr/h_ws/devel/lib/plumbing_test -- Installing devel-space wrapper /home/shr/h_ws/src/plumbing_test/scripts/t2_sub_pose_p.py to /home/shr/h_ws/devel/lib/plumbing_test -- Installing devel-space wrapper /home/shr/h_ws/src/plumbing_test/scripts/t3_server_client_p.py to /home/shr/h_ws/devel/lib/plumbing_test -- +++ processing catkin package: 'pluming_pub_sub' -- ==> add_subdirectory(pluming_pub_sub) -- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy -- pluming_pub_sub: 1 messages, 0 services -- Installing devel-space wrapper /home/shr/h_ws/src/pluming_pub_sub/scripts/d1_pub_p.py to /home/shr/h_ws/devel/lib/pluming_pub_sub -- Installing devel-space wrapper /home/shr/h_ws/src/pluming_pub_sub/scripts/d1_sub_p.py to /home/shr/h_ws/devel/lib/pluming_pub_sub -- Installing devel-space wrapper /home/shr/h_ws/src/pluming_pub_sub/scripts/d_pub_person_p.py to /home/shr/h_ws/devel/lib/pluming_pub_sub -- Installing devel-space wrapper /home/shr/h_ws/src/pluming_pub_sub/scripts/d_sub_person_p.py to /home/shr/h_ws/devel/lib/pluming_pub_sub -- Installing devel-space wrapper /home/shr/h_ws/src/pluming_pub_sub/scripts/tools.py to /home/shr/h_ws/devel/lib/pluming_pub_sub -- +++ processing catkin package: 'ros3_1' -- ==> add_subdirectory(ros3_1) -- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy CMake Error at /opt/ros/noetic/share/genmsg/cmake/genmsg-extras.cmake:151 (message): add_service_files() directory not found: /home/shr/h_ws/src/ros3_1/srv Call Stack (most recent call first): ros3_1/CMakeLists.txt:59 (add_service_files) -- Configuring incomplete, errors occurred! See also "/home/shr/h_ws/build/CMakeFiles/CMakeOutput.log". See also "/home/shr/h_ws/build/CMakeFiles/CMakeError.log". Invoking "cmake" failed
09-03
首先,创建一个共享目录:mkdir -p /home/mnt/shared。 然后,设置文件夹的权限: sudo mkdir -p/mnt/shared sudo chown -R root:sambauser /mnt/shared sudochmod -R 770 /mnt/shared 创建一个 samba用户用来访问 Samba 服务器, adduser 命令是添加用户的命令,当然也可以使用 seradd命令,也可以实现相同效果。 space@debian:~$ sudo adduser sambauser [sudo] password for space: Adding user 'sambauser'. Adding new group 'sambauser' (1001) ... Adding new user'sambauser' (1001) with group 'sambauser (1001)' ... Creating home directory'/home/sambauser'... Copying files from '/etc/skel' ... New password: Retype new password: passwd:password updated successfully Changing the user information for sambauser Enter the new value, or press ENTER for the default Full Name []: Room Number[]: Work Phone []: Home Phone[]: Other[]: Is the information correct? [Y/n] y Adding new user 'sambauser' to supplemental / extra groups 'users' n Adding user'sambauser' to group'users'... 创建用户介绍之后,可以对用户重置密码: sudo smbpasswd -a sambauser Danger 这里的重置密码是对Samba用户重置的,与Linux用户无关。且,会自动创建一个权限相同的samba用户。 添加共享 在配置系统之前需要使用备份配置文件,防止配置出现错误。 sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak.20250517 然后打开文件/etc/samba/smb.conf,在文件尾部添加下面内容: [myshare] comment= my share path=/mnt/shared browseable = yes read only = no writeable = yes valid user = sambauser 然后,重启Samba服务器即可。 sudo systemctl restart smbd sudo systemctl status smbd 测试 进入 windows文件管理器,然后输入IP地址即可。
06-14
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值